apache/seatunnel · error · UnsupportedOperationException

HugeGraph does not provide a SeaTunnel Catalog; schema and…

Error message

HugeGraph does not provide a SeaTunnel Catalog; schema and data save modes are handled via the HugeGraph client.

What it means

HugeGraphSaveModeHandler implements the SeaTunnel catalog-style SaveModeHandler interface, but the HugeGraph connector does not implement a SeaTunnel Catalog. All catalog metadata methods, including getDefaultDatabase(), are deliberately stubbed to throw UnsupportedOperationException via the private unsupported() helper. This signals that schema/save-mode handling is done through the HugeGraph client, not through SeaTunnel catalog APIs.

Solutions

  1. Do not use save modes that require catalog metadata with the HugeGraph sink; choose ERROR_WHEN_SCHEMA_NOT_EXIST / APPEND_DATA style modes that skip catalog operations.
  2. Handle schema and data creation through HugeGraph client APIs (e.g. pre-create the graph/schema) before running the job.
  3. If this comes from your own code, remove calls to getDefaultDatabase() on this handler; it is intentionally unsupported.
  4. Check whether an upstream framework component is invoking catalog methods and configure the sink to bypass that path.

Example fix

// before
handler.getDefaultDatabase();
// after
// HugeGraph sink: do not resolve a default database via catalog; pre-create schema via HugeGraph client or use a save mode that does not need catalog metadata.
Defensive patterns

Strategy: validation

Validate before calling

// Before enabling catalog-dependent save mode for a HugeGraph sink:
String mode = config.get("schema_save_mode");
if (mode != null && !mode.equals("ERROR_WHEN_SCHEMA_NOT_EXIST") && !mode.equals("IGNORE")) {
    throw new IllegalArgumentException("HugeGraph sink has no SeaTunnel Catalog; use a save mode that does not require catalog operations.");
}

Type guard

boolean supportsCatalog(SaveModeHandler h) {
    try { h.getDefaultDatabase(); return true; }
    catch (UnsupportedOperationException e) { return false; }
}

Try / catch

try {
    String db = handler.getDefaultDatabase();
} catch (UnsupportedOperationException e) {
    // HugeGraph has no SeaTunnel Catalog; fall back to HugeGraph client for schema handling
}

Prevention

When it happens

Trigger: Calling getDefaultDatabase() on a HugeGraphSaveModeHandler instance — typically when the sink's save-mode (e.g. CREATE_SCHEMA_WHEN_NOT_EXIST or a save-mode path that resolves the default database) invokes this method, or when user/test code calls it directly.

Common situations: Configuring schema_save_mode or data_save_mode options on the HugeGraph sink that require catalog metadata lookups; generic sink code paths that assume every connector provides a catalog; unit/integration tests exercising save-mode behavior against HugeGraph.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/9b79ef9ccf810f6e. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/sink/HugeGraphSaveModeHandler.java:242

     * schema/data work through its own client, so every catalog operation other than {@link
     * #name()} is unsupported and never invoked on the save-mode path.
     */
    private static final class HugeGraphNamedCatalog implements Catalog {

        @Override
        public String name() {
            return "HugeGraph";
        }

        @Override
        public void open() {}

        @Override
        public void close() {}

        @Override
        public String getDefaultDatabase() {
            throw unsupported();
        }

        @Override
        public boolean databaseExists(String databaseName) {
            throw unsupported();
        }

        @Override
        public List<String> listDatabases() {
            throw unsupported();
        }

        @Override
        public List<String> listTables(String databaseName) {
            throw unsupported();
        }

        @Override

View on GitHub (pinned to cf67b549a7)