{"record":{"id":"4851233256406b99","repo":"apache/seatunnel","slug":"config-validation-failed-485123","errorCode":"CONFIG_VALIDATION_FAILED","errorMessage":"table_options cannot be used together with a custom save_mode_create_template for StarRocks sink.","messagePattern":"table_options cannot be used together with a custom save_mode_create_template for StarRocks sink\\.","errorType":"validation","errorClass":"SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSaveModeUtil.java","lineNumber":66,"sourceCode":"    public String getCreateTableSql(\n            String template,\n            String database,\n            String table,\n            TableSchema tableSchema,\n            String comment,\n            String optionsKey,\n            Map<String, String> tableOptions) {\n        String createTableSql =\n                getCreateTableSql(template, database, table, tableSchema, comment, optionsKey);\n        return applyTableOptionsToCreateTableSql(createTableSql, tableOptions);\n    }\n\n    public void validateTableOptions(ReadonlyConfig config, Map<String, String> tableOptions) {\n        if (tableOptions == null || tableOptions.isEmpty()) {\n            return;\n        }\n        if (isCustomCreateTemplate(config)) {\n            throw new SeaTunnelRuntimeException(\n                    SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                    \"table_options cannot be used together with a custom save_mode_create_template\"\n                            + \" for StarRocks sink.\");\n        }\n        for (Map.Entry<String, String> entry : tableOptions.entrySet()) {\n            if (StringUtils.isBlank(entry.getKey())) {\n                throw new SeaTunnelRuntimeException(\n                        SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                        \"table_options contains a blank property key for StarRocks sink.\");\n            }\n            if (entry.getValue() == null) {\n                throw new SeaTunnelRuntimeException(\n                        SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED,\n                        String.format(\n                                \"table_options property '%s' has null value for StarRocks sink.\",\n                                entry.getKey()));\n            }\n        }","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSaveModeUtil.java#L48-L84","documentation":"StarRocksSaveModeUtil.validateTableOptions enforces that when the user supplies table_options (key-value DDL options merged into CREATE TABLE), the sink does NOT also use a custom save_mode_create_template. Combining both is ambiguous (template vs generated options), so a CONFIG_VALIDATION_FAILED SeaTunnelRuntimeException is thrown.","triggerScenarios":"Sink config containing both table_options entries and a non-default save_mode_create_template when auto table creation runs.","commonSituations":"Users copying an old config that had a custom create template and then adding table_options for partition/bucket tuning; upgrading SeaTunnel where table_options is newly supported while the old template remains in config.","solutions":["Remove save_mode_create_template from the sink config and let table_options drive the generated DDL","Or remove table_options and keep full control via the custom template","Decide which mechanism owns CREATE TABLE details; only one may be used"],"exampleFix":"// before\nsink = {\n  save_mode_create_template = \"CREATE TABLE (...)\"\n  table_options { replication_num = \"3\" }\n}\n// after\nsink = {\n  table_options { replication_num = \"3\" }\n}","handlingStrategy":"validation","validationCode":"if (cfg.containsKey(\"table_options\") && cfg.containsKey(\"save_mode_create_template\")) throw new IllegalArgumentException(\"Use either table_options or save_mode_create_template, not both\");","typeGuard":"boolean usesOnlyOneCreationMechanism(ReadonlyConfig c) { return !(c.get(SaveModeCreateTemplate) != null && c.get(TableOptions) != null); }","tryCatchPattern":"try { buildSink(cfg); } catch (SeaTunnelRuntimeException e) { if (e.getErrorCode() == SeaTunnelAPIErrorCode.CONFIG_VALIDATION_FAILED && e.getMessage().contains(\"table_options cannot be used together\")) { /* strip one of the two options and resubmit */ } throw e; }","preventionTips":["Choose one table-creation mechanism per sink config: template OR table_options","When migrating configs that add table_options, remove the old create template","Document the constraint in your internal config templates"],"tags":["starrocks","sink","config","save-mode"],"backgroundTag":"conflicting-config-options","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}