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

  1. Restrict previewAction calls to the supported ActionTypes (CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, CREATE_DATABASE, DROP_DATABASE)
  2. Upgrade SeaTunnel / the JDBC connector to a version that implements the new action type
  3. 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

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


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