{"record":{"id":"2332bd323bf3e812","repo":"apache/seatunnel","slug":"unknown-table-change-type","errorCode":null,"errorMessage":"Unknown table change type: ","messagePattern":"Unknown table change type: ","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/ConnectTableChangeSerializer.java","lineNumber":134,"sourceCode":"    public TableChanges deserialize(List<Struct> data, boolean useCatalogBeforeSchema) {\n        TableChanges tableChanges = new TableChanges();\n        for (Struct struct : data) {\n            String tableId = struct.getString(ID_KEY);\n            TableChanges.TableChangeType changeType =\n                    TableChanges.TableChangeType.valueOf(struct.getString(TYPE_KEY));\n            Table table = toTable(struct.getStruct(TABLE_KEY), TableId.parse(tableId));\n            switch (changeType) {\n                case CREATE:\n                    tableChanges.create(table);\n                    break;\n                case DROP:\n                    tableChanges.drop(table);\n                    break;\n                case ALTER:\n                    tableChanges.alter(table);\n                    break;\n                default:\n                    throw new IllegalArgumentException(\"Unknown table change type: \" + changeType);\n            }\n        }\n        return tableChanges;\n    }\n\n    public Table toTable(Struct struct, TableId tableId) {\n        return Table.editor()\n                .tableId(tableId)\n                .setDefaultCharsetName(struct.getString(DEFAULT_CHARSET_NAME_KEY))\n                .setPrimaryKeyNames(struct.getArray(PRIMARY_KEY_COLUMN_NAMES_KEY))\n                .setColumns(\n                        struct.getArray(COLUMNS_KEY).stream()\n                                .map(Struct.class::cast)\n                                .map(this::toColumn)\n                                .collect(Collectors.toList()))\n                .create();\n    }\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/ConnectTableChangeSerializer.java#L116-L152","documentation":"ConnectTableChangeSerializer.deserialize() rebuilds table-change events from their serialized form. Each change has a type (CREATE, DROP, ALTER); any other value hits the default branch and throws IllegalArgumentException 'Unknown table change type'. This protects against corrupt or future-version payloads.","triggerScenarios":"Deserializing a serialized TableChanges record whose changeType is null or not CREATE/DROP/ALTER, e.g. reading a schema-history payload written by a newer/older Debezium version with different enum values.","commonSituations":"Corrupted schema history storage (database-table history or file history) reused across SeaTunnel/Debezium upgrades; hand-edited history records.","solutions":["Check the stored schema history for records with an unrecognized change type and remove/repair them.","Align the Debezium version used by the SeaTunnel CDC connector with the version that wrote the history, or reset the schema history store.","Log the full changeType value and inspect the serialized payload to confirm corruption vs a genuinely new enum value."],"exampleFix":"// before\n// deserializing history produced by mismatched Debezium version\n// after\n// clear the schema history table/file so it is rebuilt from a fresh snapshot","handlingStrategy":"validation","validationCode":"// Java\nif (changeType != null\n    && (changeType.equals(\"CREATE\") || changeType.equals(\"DROP\") || changeType.equals(\"ALTER\"))) {\n    deserialize(change); // safe\n}","typeGuard":"switch (changeType) {\n    case CREATE: case DROP: case ALTER: /* ok */ break;\n    default: log.error(\"skipping unknown change type: {}\", changeType); return;\n}","tryCatchPattern":"try {\n    changes = serializer.deserialize(value, schema);\n} catch (IllegalArgumentException e) {\n    log.error(\"corrupt/unknown table change in history: {}\", e.getMessage());\n    // quarantine record and continue or rebuild schema history\n}","preventionTips":["Do not share schema-history stores across different Debezium/SeaTunnel versions","Validate and back up schema history tables/files before upgrading","Reset schema history and take a fresh snapshot after corruption is detected"],"tags":["cdc","debezium","deserialization","enum"],"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"}