{"record":{"id":"5649dda9aee8a657","repo":"apache/seatunnel","slug":"create-hive-table-failed","errorCode":"CREATE_HIVE_TABLE_FAILED","errorMessage":"Unsupported schema save mode: ","messagePattern":"Unsupported schema save mode: ","errorType":"error_code","errorClass":"HiveConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/sink/HiveSaveModeHandler.java","lineNumber":129,"sourceCode":"        try {\n            switch (schemaSaveMode) {\n                case RECREATE_SCHEMA:\n                    handleRecreateSchema();\n                    break;\n                case CREATE_SCHEMA_WHEN_NOT_EXIST:\n                    handleCreateSchemaWhenNotExist();\n                    break;\n                case ERROR_WHEN_SCHEMA_NOT_EXIST:\n                    handleErrorWhenSchemaNotExist();\n                    break;\n                case IGNORE:\n                    log.info(\n                            \"Ignore schema save mode, skip schema handling for table {}.{}\",\n                            dbName,\n                            tableName);\n                    break;\n                default:\n                    throw new HiveConnectorException(\n                            HiveConnectorErrorCode.CREATE_HIVE_TABLE_FAILED,\n                            \"Unsupported schema save mode: \" + schemaSaveMode);\n            }\n        } catch (HiveConnectorException e) {\n            throw e;\n        } catch (TException e) {\n            throw new HiveConnectorException(\n                    HiveConnectorErrorCode.CREATE_HIVE_TABLE_FAILED,\n                    \"Failed to handle schema save mode: \" + e.getMessage(),\n                    e);\n        }\n    }\n\n    @Override\n    public void handleDataSaveMode() {\n        // No-op: data cleanup is handled in AggregatedCommitter via overwrite or DROP_DATA\n    }\n","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/sink/HiveSaveModeHandler.java#L111-L147","documentation":"Hive sink's schema save mode switch (handleSchemaSaveMode) only supports the known modes (CREATE_SCHEMA_WHEN_NOT_EXIST, RECREATE_SCHEMA, ERROR, IGNORE); any other value hits the default branch and throws HiveConnectorException(CREATE_HIVE_TABLE_FAILED). This guards against misspelled or invalid schema_save_mode values.","triggerScenarios":"Configuring the Hive sink with a schema_save_mode (schema save mode) string that is not one of the supported enum values, reaching handleSchemaSaveMode's switch default. Called via handleSchemaSaveModeWithRestore at sink initialization.","commonSituations":"Typo such as 'create_schema_when_not_exists' with wrong casing or extra spaces; copying config from an older/newer SeaTunnel version with different option names; template placeholders left unfilled.","solutions":["Set schema_save_mode to exactly one of: CREATE_SCHEMA_WHEN_NOT_EXIST, RECREATE_SCHEMA, ERROR, IGNORE (check the connector docs for exact accepted strings).","Check for typos/case mismatch in the config key value — matching is exact string comparison.","Compare against the version-appropriate documentation; option values can differ between SeaTunnel releases.","Print/log the resolved config value to confirm what the job actually parsed."],"exampleFix":"// before\nschema_save_mode = \"CREATE_IF_NOT_EXIST\"\n// after\nschema_save_mode = \"CREATE_SCHEMA_WHEN_NOT_EXIST\"","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"CREATE_SCHEMA_WHEN_NOT_EXIST\",\"RECREATE_SCHEMA\",\"ERROR\",\"IGNORE\");\nif (!allowed.contains(config.get(\"schema_save_mode\"))) throw new IllegalArgumentException(\"schema_save_mode must be one of \" + allowed);","typeGuard":null,"tryCatchPattern":"try {\n  sink.open(...);\n} catch (HiveConnectorException e) {\n  if (e.getErrorCode() == HiveConnectorErrorCode.CREATE_HIVE_TABLE_FAILED\n      && e.getMessage().startsWith(\"Unsupported schema save mode\")) {\n    // fix schema_save_mode value and resubmit\n  }\n}","preventionTips":["Copy enum values verbatim from the connector documentation.","Use an enum/constant in generated configs rather than free text.","Add schema validation of the HOCON config in CI.","Strip whitespace and enforce exact casing in config templating."],"tags":["hive","sink","schema-save-mode","enum","config"],"backgroundTag":"invalid-enum-value","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"}