{"record":{"id":"6cb9e0970ea9cb59","repo":"apache/seatunnel","slug":"unsupported-schemachangeevent-6cb9e0","errorCode":null,"errorMessage":"Unsupported schemaChangeEvent: ","messagePattern":"Unsupported schemaChangeEvent: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialect.java","lineNumber":569,"sourceCode":"                AlterTableDropColumnEvent dropColumnEvent = (AlterTableDropColumnEvent) event;\n                if (!columnExists(connection, tablePath, dropColumnEvent.getColumn())) {\n                    log.warn(\n                            \"Column {} does not exist in table {}. Skipping drop column operation. event: {}\",\n                            dropColumnEvent.getColumn(),\n                            tablePath.getFullName(),\n                            event);\n                    return;\n                }\n                applySchemaChange(connection, tablePath, dropColumnEvent);\n            } else if (event instanceof AlterTableCommentEvent\n                    || event instanceof AlterColumnCommentEvent) {\n                // Comment-only changes are not supported by JDBC sink, safely ignore\n                log.info(\n                        \"Ignoring comment change event for table {} - JDBC sink does not support comment sync: {}\",\n                        tablePath.getFullName(),\n                        event.getClass().getSimpleName());\n            } else {\n                throw new UnsupportedOperationException(\"Unsupported schemaChangeEvent: \" + event);\n            }\n        }\n    }\n\n    /**\n     * Check if the column exists in the table\n     *\n     * @param connection\n     * @param tablePath\n     * @param column\n     * @return\n     */\n    default boolean columnExists(Connection connection, TablePath tablePath, String column) {\n        String selectColumnSQL =\n                String.format(\n                        \"SELECT %s FROM %s WHERE 1 != 1\",\n                        quoteIdentifier(column), tableIdentifier(tablePath));\n        try (Statement statement = connection.createStatement()) {","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialect.java#L551-L587","documentation":"JdbcDialect.applySchemaChange() handles a fixed set of schema change events (ADD COLUMN, DROP COLUMN, RENAME COLUMN, MODIFY/CHANGE column type, etc.) and throws this UnsupportedOperationException for any event kind it does not recognize. It is thrown synchronously while applying a schema evolution event to a JDBC sink table, meaning the sink received an event outside its supported matrix. Comment-only events are explicitly ignored, so anything reaching the else branch is genuinely unhandled.","triggerScenarios":"Calling applySchemaChange() with an event type outside the supported switch, e.g. truncate table events, unsupported alter types, or new SchemaChangeEvent subclasses introduced in a newer CDC/source connector that this dialect has not been updated to map.","commonSituations":"Running a SeaTunnel CDC (MySQL/PostgreSQL/StarRocks-style) pipeline whose sink is the generic JDBC connector and the upstream database emits a DDL event (e.g. TRUNCATE, multi-statement ALTER, exotic column attribute changes) that the JDBC dialect does not implement; upgrading the source connector's CDC library so new event types appear while the JDBC sink lags behind.","solutions":["Check the event class being thrown and whether JdbcDialect.applySchemaChange() handles it; if it is a new upstream event type, upgrade SeaTunnel to a version that supports it","Exclude or filter DDL/schema-change events on the source side (e.g. enable schema evolution only for supported change types, or disable schema evolution) so unhandled events never reach the JDBC sink","Use a sink dialect that supports the event (e.g. StarRocks/Doris/Iceberg sinks with fuller schema-evolution support) instead of the generic JDBC sink","Implement the missing case in a custom JdbcDialect subclass overriding applySchemaChange(), or contribute support upstream"],"exampleFix":"// before: pipeline forwards all CDC events to JDBC sink, TRUNCATE event -> UnsupportedOperationException\n// after: restrict schema evolution events on the source\nsource {\n  MySQL-CDC {\n    ...\n    schema-evolution = false  # or filter truncate/unsupported DDL at the source\n  }\n}","handlingStrategy":"try-catch","validationCode":"// before forwarding schema events, check the dialect handles them\nif (!isSupportedSchemaChangeEvent(event)) {\n  log.warn(\"Skipping unsupported schema change: {}\", event.getClass().getSimpleName());\n  return;\n}","typeGuard":"function isSupportedSchemaChangeEvent(event) {\n  const supported = ['AddColumnEvent','DropColumnEvent','RenameColumnEvent','ChangeColumnTypeEvent','ModifyColumnEvent'];\n  return event != null && supported.includes(event.constructor.name);\n}","tryCatchPattern":"try {\n  dialect.applySchemaChange(tablePath, event);\n} catch (UnsupportedOperationException e) {\n  log.warn(\"JDBC sink cannot apply schema change {}, skipping: {}\", event, e.getMessage());\n  // optionally route to dead-letter / manual DDL queue\n}","preventionTips":["Disable schema evolution on the source when the JDBC sink dialect lacks support","Pin source and sink connector versions so their schema-change event sets match","Check SeaTunnel release notes for newly added SchemaChangeEvent types before upgrading the CDC source","Test DDL scenarios (add/drop/rename/truncate) against your sink dialect before production"],"tags":["jdbc","schema-evolution","unsupported-operation"],"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"}