apache/seatunnel · error · UnsupportedOperationException

Unsupported schemaChangeEvent:

Error message

Unsupported schemaChangeEvent: 

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/JdbcDialect.java:569

                AlterTableDropColumnEvent dropColumnEvent = (AlterTableDropColumnEvent) event;
                if (!columnExists(connection, tablePath, dropColumnEvent.getColumn())) {
                    log.warn(
                            "Column {} does not exist in table {}. Skipping drop column operation. event: {}",
                            dropColumnEvent.getColumn(),
                            tablePath.getFullName(),
                            event);
                    return;
                }
                applySchemaChange(connection, tablePath, dropColumnEvent);
            } else if (event instanceof AlterTableCommentEvent
                    || event instanceof AlterColumnCommentEvent) {
                // Comment-only changes are not supported by JDBC sink, safely ignore
                log.info(
                        "Ignoring comment change event for table {} - JDBC sink does not support comment sync: {}",
                        tablePath.getFullName(),
                        event.getClass().getSimpleName());
            } else {
                throw new UnsupportedOperationException("Unsupported schemaChangeEvent: " + event);
            }
        }
    }

    /**
     * Check if the column exists in the table
     *
     * @param connection
     * @param tablePath
     * @param column
     * @return
     */
    default boolean columnExists(Connection connection, TablePath tablePath, String column) {
        String selectColumnSQL =
                String.format(
                        "SELECT %s FROM %s WHERE 1 != 1",
                        quoteIdentifier(column), tableIdentifier(tablePath));
        try (Statement statement = connection.createStatement()) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. 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
  2. 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
  3. 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
  4. Implement the missing case in a custom JdbcDialect subclass overriding applySchemaChange(), or contribute support upstream

Example fix

// before: pipeline forwards all CDC events to JDBC sink, TRUNCATE event -> UnsupportedOperationException
// after: restrict schema evolution events on the source
source {
  MySQL-CDC {
    ...
    schema-evolution = false  # or filter truncate/unsupported DDL at the source
  }
}
Defensive patterns

Strategy: try-catch

Validate before calling

// before forwarding schema events, check the dialect handles them
if (!isSupportedSchemaChangeEvent(event)) {
  log.warn("Skipping unsupported schema change: {}", event.getClass().getSimpleName());
  return;
}

Type guard

function isSupportedSchemaChangeEvent(event) {
  const supported = ['AddColumnEvent','DropColumnEvent','RenameColumnEvent','ChangeColumnTypeEvent','ModifyColumnEvent'];
  return event != null && supported.includes(event.constructor.name);
}

Try / catch

try {
  dialect.applySchemaChange(tablePath, event);
} catch (UnsupportedOperationException e) {
  log.warn("JDBC sink cannot apply schema change {}, skipping: {}", event, e.getMessage());
  // optionally route to dead-letter / manual DDL queue
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/6cb9e0970ea9cb59. Report an issue: GitHub.