{"record":{"id":"ce89b0cc02d4ccc5","repo":"apache/seatunnel","slug":"unsupported-alter-table-event","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/AlterTableEventHandler.java","lineNumber":89,"sourceCode":"        if (alterTableEvent instanceof AlterTableModifyColumnEvent) {\n            return applyModifyColumn(dataType, (AlterTableModifyColumnEvent) alterTableEvent);\n        }\n        if (alterTableEvent instanceof AlterTableChangeColumnEvent) {\n            return applyChangeColumn(dataType, (AlterTableChangeColumnEvent) alterTableEvent);\n        }\n        if (alterTableEvent instanceof AlterTableAddColumnEvent) {\n            return applyAddColumn(dataType, (AlterTableAddColumnEvent) alterTableEvent);\n        }\n        if (alterTableEvent instanceof AlterTableColumnsEvent) {\n            SeaTunnelRowType newType = dataType;\n            for (AlterTableColumnEvent columnEvent :\n                    ((AlterTableColumnsEvent) alterTableEvent).getEvents()) {\n                newType = apply(newType, columnEvent);\n            }\n            return newType;\n        }\n\n        throw new UnsupportedOperationException(\n                \"Unsupported alter table event: \" + alterTableEvent);\n    }\n\n    private SeaTunnelRowType applyAddColumn(\n            SeaTunnelRowType dataType, AlterTableAddColumnEvent addColumnEvent) {\n        LinkedList<String> originFields = new LinkedList<>(Arrays.asList(dataType.getFieldNames()));\n        LinkedList<SeaTunnelDataType<?>> originFieldTypes =\n                new LinkedList<>(Arrays.asList(dataType.getFieldTypes()));\n        Column column = addColumnEvent.getColumn();\n        if (originFields.contains(column.getName())) {\n            return applyModifyColumn(\n                    dataType,\n                    new AlterTableModifyColumnEvent(\n                            addColumnEvent.tableIdentifier(),\n                            addColumnEvent.getColumn(),\n                            addColumnEvent.isFirst(),\n                            addColumnEvent.getAfterColumn()));\n        }","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/schema/handler/AlterTableEventHandler.java#L71-L107","documentation":"Thrown by AlterTableEventHandler.apply when a SchemaChangeEvent is not one of the supported event types (add/rename/modify/drop column, AlterTableColumnsEvent, etc.). The handler cannot translate the event into row-type changes, so it refuses with UnsupportedOperationException naming the event.","triggerScenarios":"Passing a SchemaChangeEvent subclass not covered by the instanceof chain in apply (e.g. a new/custom event type or schema-change event like AlterColumnCommentEvent handled elsewhere) to AlterTableEventHandler.apply.","commonSituations":"CDC pipelines where the upstream database emits a DDL event type the SeaTunnel version does not yet support; forwarding raw schema-change events from connectors into the row-type handler; mixing handler implementations (row-type vs TableSchema) with unsupported event types.","solutions":["Upgrade SeaTunnel to a version whose AlterTableEventHandler supports the event type.","Route the event to the correct handler (e.g. AlterTableSchemaEventHandler for schema-level events like column comments).","Filter or degrade unsupported schema-change events in the connector before applying them to the row type.","Extend the handler (subclass/override apply) if you own a custom event type."],"exampleFix":"// before\nSeaTunnelRowType newType = AlterTableEventHandler.apply(rowType, commentEvent); // unsupported\n// after\nTableSchema schema = AlterTableSchemaEventHandler.apply(tableSchema, commentEvent);","handlingStrategy":"try-catch","validationCode":"if (!(event instanceof AlterTableAddColumnEvent || event instanceof AlterTableColumnsEvent || event instanceof AlterTableRenameColumnEvent || event instanceof AlterTableModifyColumnEvent || event instanceof AlterTableDropColumnEvent)) { log.warn(\"unsupported event {}\", event); return dataType; }","typeGuard":"boolean supported = event instanceof AlterTableColumnEvent || event instanceof AlterTableColumnsEvent;","tryCatchPattern":"try { return AlterTableEventHandler.apply(rowType, event); } catch (UnsupportedOperationException e) { log.warn(\"skipping unsupported alter event: {}\", e.getMessage()); return rowType; }","preventionTips":["Upgrade SeaTunnel when new upstream DDL types appear","Filter schema events by supported types in the connector","Route events to the correct handler class"],"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"}