apache/seatunnel · error · UnsupportedOperationException
Unsupported action type:
Error message
Unsupported action type:
What it means
ClickhouseCatalog.previewAction executes one of several supported DDL preview actions (CREATE/DROP TABLE, CREATE/DROP DATABASE). If the caller passes an ActionType the catalog does not implement (anything other than those four), it throws UnsupportedOperationException with the offending ActionType. It signals an unhandled/unsupported catalog operation rather than a config or SQL problem.
Source
Thrown at seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseCatalog.java:277
catalogTable.get().getTableSchema(),
catalogTable.get().getComment(),
ClickhouseSinkOptions.SAVE_MODE_CREATE_TEMPLATE.key()));
} else if (actionType == ActionType.DROP_TABLE) {
return new SQLPreviewResult(
ClickhouseCatalogUtil.INSTANCE.getDropTableSql(tablePath, true));
} else if (actionType == ActionType.TRUNCATE_TABLE) {
return new SQLPreviewResult(
ClickhouseCatalogUtil.INSTANCE.getTruncateTableSql(tablePath));
} else if (actionType == ActionType.CREATE_DATABASE) {
return new SQLPreviewResult(
ClickhouseCatalogUtil.INSTANCE.getCreateDatabaseSql(
tablePath.getDatabaseName(), true));
} else if (actionType == ActionType.DROP_DATABASE) {
return new SQLPreviewResult(
ClickhouseCatalogUtil.INSTANCE.getDropDatabaseSql(
tablePath.getDatabaseName(), true));
} else {
throw new UnsupportedOperationException("Unsupported action type: " + actionType);
}
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Only call previewAction with the four ActionTypes ClickhouseCatalog supports (CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE).
- Catch UnsupportedOperationException and handle unsupported actions gracefully (skip or show 'not supported' in tooling).
- Check the ClickhouseCatalog source for the supported set before adding new ActionType usage, and implement the missing branch in previewAction if you need it.
- Upgrade the connector to a version that implements the ActionType you need, if newer releases added it.
Example fix
// before
SQLPreviewResult result = catalog.previewAction(ActionType.TRUNCATE_TABLE, ...);
// after
if (actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE
|| actionType == ActionType.CREATE_DATABASE || actionType == ActionType.DROP_DATABASE) {
SQLPreviewResult result = catalog.previewAction(actionType, ...);
} else {
throw new UnsupportedOperationException("Clickhouse catalog does not support: " + actionType);
} Defensive patterns
Strategy: try-catch
Validate before calling
private static final Set<ActionType> SUPPORTED = Set.of(ActionType.CREATE_TABLE, ActionType.DROP_TABLE, ActionType.CREATE_DATABASE, ActionType.DROP_DATABASE);
if (!SUPPORTED.contains(actionType)) { throw new IllegalArgumentException("ClickhouseCatalog does not support " + actionType); } Type guard
boolean supported = actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE || actionType == ActionType.CREATE_DATABASE || actionType == ActionType.DROP_DATABASE;
Try / catch
try { result = catalog.previewAction(actionType, sql, params); } catch (UnsupportedOperationException e) { log.warn("Clickhouse catalog does not support preview for {}: {}", actionType, e.getMessage()); result = null; } Prevention
- Enumerate the supported ActionTypes from the catalog implementation before generic iteration.
- When upstream adds a new ActionType, audit every catalog implementation for a matching branch.
- Centralize DDL preview calls in one helper that handles unsupported actions uniformly.
When it happens
Trigger: Calling SeaTunnelCatalog.previewAction on a ClickhouseCatalog with an ActionType that is not CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, or DROP_DATABASE — e.g. TRUNCATE_TABLE or a newly added ActionType the Clickhouse connector has not implemented.
Common situations: Engine or tooling code iterates over all ActionType values generically and calls previewAction for each; a new ActionType added upstream before ClickhouseCatalog supports it; user tooling invoking unsupported DDL preview through the catalog API.
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
- Failed EXECUTE SQL in catalog %s
- Failed getting table %s
- Truncate table failed
- LIST_DATABASES_FAILED
- LIST_TABLES_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/dfe5ec46499a8087.
Report an issue: GitHub.