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

  1. Only call previewAction with the four ActionTypes ClickhouseCatalog supports (CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE).
  2. Catch UnsupportedOperationException and handle unsupported actions gracefully (skip or show 'not supported' in tooling).
  3. Check the ClickhouseCatalog source for the supported set before adding new ActionType usage, and implement the missing branch in previewAction if you need it.
  4. 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

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


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