apache/seatunnel · error · UnsupportedOperationException
Unsupported action type:
Error message
Unsupported action type:
What it means
previewAction only supports a fixed set of ActionTypes (CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, CREATE_DATABASE, DROP_DATABASE). Any other ActionType reaches the else branch and throws UnsupportedOperationException with 'Unsupported action type: <type>'.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/AbstractJdbcCatalog.java:750
}
}
@Override
public PreviewResult previewAction(
ActionType actionType, TablePath tablePath, Optional<CatalogTable> catalogTable) {
if (actionType == ActionType.CREATE_TABLE) {
checkArgument(catalogTable.isPresent(), "CatalogTable cannot be null");
return new SQLPreviewResult(getCreateTableSql(tablePath, catalogTable.get(), true));
} else if (actionType == ActionType.DROP_TABLE) {
return new SQLPreviewResult(getDropTableSql(tablePath));
} else if (actionType == ActionType.TRUNCATE_TABLE) {
return new SQLPreviewResult(getTruncateTableSql(tablePath));
} else if (actionType == ActionType.CREATE_DATABASE) {
return new SQLPreviewResult(getCreateDatabaseSql(tablePath.getDatabaseName()));
} else if (actionType == ActionType.DROP_DATABASE) {
return new SQLPreviewResult(getDropDatabaseSql(tablePath.getDatabaseName()));
} else {
throw new UnsupportedOperationException("Unsupported action type: " + actionType);
}
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Restrict previewAction calls to the supported ActionTypes (CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, CREATE_DATABASE, DROP_DATABASE)
- Upgrade SeaTunnel / the JDBC connector to a version that implements the new action type
- Handle UnsupportedOperationException defensively when previewing arbitrary action types
Example fix
// before
catalog.previewAction(unknownActionType, tablePath, Optional.empty());
// after
if (actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE
|| actionType == ActionType.TRUNCATE_TABLE
|| actionType == ActionType.CREATE_DATABASE || actionType == ActionType.DROP_DATABASE) {
catalog.previewAction(actionType, tablePath, Optional.empty());
} Defensive patterns
Strategy: validation
Validate before calling
// Java
private static final Set<ActionType> SUPPORTED = Set.of(
ActionType.CREATE_TABLE, ActionType.DROP_TABLE, ActionType.TRUNCATE_TABLE,
ActionType.CREATE_DATABASE, ActionType.DROP_DATABASE);
boolean previewable = SUPPORTED.contains(actionType); Prevention
- Whitelist ActionTypes before calling previewAction rather than passing arbitrary values
- After upgrading SeaTunnel, re-check which ActionTypes the JDBC catalog supports
- Never iterate all ActionType values generically against this catalog
When it happens
Trigger: Calling catalog.previewAction(actionType, tablePath, catalogTable) with an ActionType outside the supported set, e.g. newer enum values added to the API that the JDBC catalog has not implemented.
Common situations: Calling preview on newly introduced action types after a SeaTunnel version upgrade; generic tooling that iterates all ActionType values against every catalog.
Related errors
- Unsupported constraint type:
- Unsupported constraint type:
- Unsupported JDBC type:
- %s (%s) type doesn't have a mapping to the SQL database colu
- TypeConverter is not supported
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/bfb535e24aca3e56.
Report an issue: GitHub.