{"record":{"id":"4281ea3e082d6ee6","repo":"apache/seatunnel","slug":"schema-config-can-not-be-empty","errorCode":null,"errorMessage":"Schema config can not be empty","messagePattern":"Schema config can not be empty","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/CatalogTableUtil.java","lineNumber":107,"sourceCode":"     */\n    @Deprecated\n    public static List<CatalogTable> getCatalogTables(\n            ReadonlyConfig readonlyConfig, ClassLoader classLoader) {\n\n        // We use plugin_name as factoryId, so MySQL-CDC should be MySQL\n        String factoryId =\n                readonlyConfig.get(ConnectorCommonOptions.PLUGIN_NAME).replace(\"-CDC\", \"\");\n        return getCatalogTables(factoryId, readonlyConfig, classLoader);\n    }\n\n    @Deprecated\n    public static List<CatalogTable> getCatalogTables(\n            String factoryId, ReadonlyConfig readonlyConfig, ClassLoader classLoader) {\n        // Highest priority: specified schema\n        Map<String, Object> schemaMap = readonlyConfig.get(ConnectorCommonOptions.SCHEMA);\n        if (schemaMap != null) {\n            if (schemaMap.isEmpty()) {\n                throw new SeaTunnelException(\"Schema config can not be empty\");\n            }\n            CatalogTable catalogTable = CatalogTableUtil.buildWithConfig(factoryId, readonlyConfig);\n            return Collections.singletonList(catalogTable);\n        }\n\n        Optional<Catalog> optionalCatalog =\n                FactoryUtil.createOptionalCatalog(\n                        factoryId, readonlyConfig, classLoader, factoryId);\n        return optionalCatalog\n                .map(\n                        c -> {\n                            try (Catalog catalog = c) {\n                                long startTime = System.currentTimeMillis();\n                                catalog.open();\n                                List<CatalogTable> catalogTables =\n                                        catalog.getTables(readonlyConfig);\n                                log.info(\n                                        String.format(","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/CatalogTableUtil.java#L89-L125","documentation":"CatalogTableUtil.getCatalogTables treats an explicitly present but empty 'schema' config block as invalid. If the user wrote a schema key with no fields, the utility cannot build a meaningful CatalogTable, so it throws SeaTunnelException.","triggerScenarios":"Config contains schema = {} (or schema present with no fields/contents) for a connector; getCatalogTables detects schemaMap non-null but empty.","commonSituations":"HOCON config typo leaving an empty schema block; copying a template and deleting schema contents but not the key; programmatic config construction adding an empty SCHEMA map.","solutions":["Either remove the empty schema block so the connector derives the schema from the catalog, or fill in complete schema fields (fields, fieldType)","Validate the config locally (e.g. seatunnel.sh --config ... -m localhost dry run) before submitting","If generating configs in code, only set ConnectorCommonOptions.SCHEMA when the map is non-empty"],"exampleFix":"// before\nschema = {}\n// after\nschema = {\n  fields {\n    id = bigint\n    name = string\n  }\n}","handlingStrategy":"validation","validationCode":"Map<String,Object> schema = config.get(ConnectorCommonOptions.SCHEMA);\nif (schema != null && schema.isEmpty()) throw new IllegalArgumentException(\"schema block must not be empty\");","typeGuard":null,"tryCatchPattern":"try { tables = CatalogTableUtil.getCatalogTables(factoryId, cfg, cl); } catch (SeaTunnelException e) { /* inspect schema block */ }","preventionTips":["Never leave an empty schema block in configs","Remove schema key entirely to use catalog-derived schema","Validate configs before submission"],"tags":["config","schema","validation"],"backgroundTag":"empty-required-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}