{"record":{"id":"9b79ef9ccf810f6e","repo":"apache/seatunnel","slug":"hugegraph-does-not-provide-a-seatunnel-catalog-sc","errorCode":null,"errorMessage":"HugeGraph does not provide a SeaTunnel Catalog; schema and data save modes are handled via the HugeGraph client.","messagePattern":"HugeGraph does not provide a SeaTunnel Catalog; schema and data save modes are handled via the HugeGraph client\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/sink/HugeGraphSaveModeHandler.java","lineNumber":242,"sourceCode":"     * schema/data work through its own client, so every catalog operation other than {@link\n     * #name()} is unsupported and never invoked on the save-mode path.\n     */\n    private static final class HugeGraphNamedCatalog implements Catalog {\n\n        @Override\n        public String name() {\n            return \"HugeGraph\";\n        }\n\n        @Override\n        public void open() {}\n\n        @Override\n        public void close() {}\n\n        @Override\n        public String getDefaultDatabase() {\n            throw unsupported();\n        }\n\n        @Override\n        public boolean databaseExists(String databaseName) {\n            throw unsupported();\n        }\n\n        @Override\n        public List<String> listDatabases() {\n            throw unsupported();\n        }\n\n        @Override\n        public List<String> listTables(String databaseName) {\n            throw unsupported();\n        }\n\n        @Override","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/sink/HugeGraphSaveModeHandler.java#L224-L260","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Handle schema and data creation through HugeGraph client APIs (e.g. pre-create the graph/schema) before running the job.","If this comes from your own code, remove calls to getDefaultDatabase() on this handler; it is intentionally unsupported.","Check whether an upstream framework component is invoking catalog methods and configure the sink to bypass that path."],"exampleFix":"// before\nhandler.getDefaultDatabase();\n// after\n// 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.","handlingStrategy":"validation","validationCode":"// Before enabling catalog-dependent save mode for a HugeGraph sink:\nString mode = config.get(\"schema_save_mode\");\nif (mode != null && !mode.equals(\"ERROR_WHEN_SCHEMA_NOT_EXIST\") && !mode.equals(\"IGNORE\")) {\n    throw new IllegalArgumentException(\"HugeGraph sink has no SeaTunnel Catalog; use a save mode that does not require catalog operations.\");\n}","typeGuard":"boolean supportsCatalog(SaveModeHandler h) {\n    try { h.getDefaultDatabase(); return true; }\n    catch (UnsupportedOperationException e) { return false; }\n}","tryCatchPattern":"try {\n    String db = handler.getDefaultDatabase();\n} catch (UnsupportedOperationException e) {\n    // HugeGraph has no SeaTunnel Catalog; fall back to HugeGraph client for schema handling\n}","preventionTips":["Treat HugeGraphSaveModeHandler as client-backed only: never rely on its catalog metadata methods.","Pre-create HugeGraph graphs and schema labels before submitting the job.","Restrict schema_save_mode/data_save_mode for HugeGraph to catalog-free values in config templates.","Check the connector docs table for catalog support before using generic save-mode tooling."],"tags":["unsupported-operation","catalog","hugegraph","sink","save-mode"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}