{"record":{"id":"b95a84bf256e9829","repo":"apache/seatunnel","slug":"unsupported-alter-table-event-b95a84","errorCode":null,"errorMessage":"Unsupported alter table event: ","messagePattern":"Unsupported alter table event: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/schema/handler/AlterTableSchemaEventHandler.java","lineNumber":94,"sourceCode":"            return applyAddColumn(schema, (AlterTableAddColumnEvent) alterTableEvent);\n        }\n        if (alterTableEvent instanceof AlterTableColumnsEvent) {\n            TableSchema newSchema = schema;\n            for (AlterTableColumnEvent columnEvent :\n                    ((AlterTableColumnsEvent) alterTableEvent).getEvents()) {\n                newSchema = apply(newSchema, columnEvent);\n            }\n            return newSchema;\n        }\n        if (alterTableEvent instanceof AlterTableCommentEvent) {\n            // Table comment changes do not affect the physical schema structure\n            return schema;\n        }\n        if (alterTableEvent instanceof AlterColumnCommentEvent) {\n            return applyColumnComment(schema, (AlterColumnCommentEvent) alterTableEvent);\n        }\n\n        throw new UnsupportedOperationException(\n                \"Unsupported alter table event: \" + alterTableEvent);\n    }\n\n    private TableSchema applyAddColumn(\n            TableSchema schema, AlterTableAddColumnEvent addColumnEvent) {\n        LinkedList<String> originFields = new LinkedList<>(Arrays.asList(schema.getFieldNames()));\n        Column column = addColumnEvent.getColumn();\n        if (originFields.contains(column.getName())) {\n            return applyModifyColumn(\n                    schema,\n                    new AlterTableModifyColumnEvent(\n                            addColumnEvent.tableIdentifier(),\n                            addColumnEvent.getColumn(),\n                            addColumnEvent.isFirst(),\n                            addColumnEvent.getAfterColumn()));\n        }\n\n        LinkedList<Column> newColumns = new LinkedList<>(schema.getColumns());","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/schema/handler/AlterTableSchemaEventHandler.java#L76-L112","documentation":"Thrown by AlterTableSchemaEventHandler.apply when the incoming SchemaChangeEvent is not among the event types this TableSchema-level handler supports (add column, column comment, etc.). Any unrecognized event falls through the instanceof chain and raises UnsupportedOperationException.","triggerScenarios":"Applying an event type not handled by this class — e.g. AlterTableColumnsEvent or rename events intended for the row-type handler — to AlterTableSchemaEventHandler.apply on a TableSchema.","commonSituations":"CDC connectors forwarding DDL events newer than the installed SeaTunnel version; choosing the wrong handler class for the event granularity; custom schema events from third-party connectors.","solutions":["Upgrade SeaTunnel so the handler supports the event type.","Dispatch the event to the appropriate handler (row-type handler for column-structure events on SeaTunnelRowType).","Drop or transform unsupported events in the connector's schema-change pipeline.","Add a custom handler branch for the unsupported event type."],"exampleFix":"// before\nschema = AlterTableSchemaEventHandler.apply(schema, alterTableColumnsEvent); // unsupported\n// after\nrowType = AlterTableEventHandler.apply(rowType, alterTableColumnsEvent);","handlingStrategy":"try-catch","validationCode":"if (!(event instanceof AlterTableAddColumnEvent || event instanceof AlterColumnCommentEvent)) { throw new IllegalArgumentException(\"unsupported schema event: \" + event); }","typeGuard":"boolean schemaLevel = event instanceof AlterColumnCommentEvent || event instanceof AlterTableAddColumnEvent;","tryCatchPattern":"try { return AlterTableSchemaEventHandler.apply(schema, event); } catch (UnsupportedOperationException e) { log.warn(\"unhandled schema event: {}\", event); return schema; }","preventionTips":["Match event type to handler granularity","Upgrade SeaTunnel for newer DDL support","Whitelist supported events in CDC ingestion"],"tags":["schema","schema-change","unsupported-event","cdc"],"backgroundTag":"unsupported-operation","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"}