apache/seatunnel · error · UnsupportedOperationException

Unsupported action type:

Error message

Unsupported action type: 

What it means

Thrown by IcebergCatalog.previewAction when the requested ActionType is not one of the handled preview actions (CREATE_TABLE, DROP_TABLE, etc.) — an unhandled enum branch in the action-type switch, i.e. an unsupported catalog action preview.

Source

Thrown at seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/catalog/IcebergCatalog.java:365

        return null;
    }

    @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 InfoPreviewResult("create table " + toIcebergTableIdentifier(tablePath));
        } else if (actionType == ActionType.DROP_TABLE) {
            return new InfoPreviewResult("drop table " + toIcebergTableIdentifier(tablePath));
        } else if (actionType == ActionType.TRUNCATE_TABLE) {
            return new InfoPreviewResult("truncate table " + toIcebergTableIdentifier(tablePath));
        } else if (actionType == ActionType.CREATE_DATABASE) {
            return new InfoPreviewResult("do nothing");
        } else if (actionType == ActionType.DROP_DATABASE) {
            return new InfoPreviewResult("do nothing");
        } else {
            throw new UnsupportedOperationException("Unsupported action type: " + actionType);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Only invoke previewAction with supported action types (CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, CREATE_DATABASE, DROP_DATABASE).
  2. Upgrade the connector module so it covers the new ActionType.
  3. Handle UnsupportedOperationException at the call site and fall back to a generic preview message.
  4. Add a branch for the missing ActionType in IcebergCatalog.previewAction.

Example fix

// before
PreviewResult r = catalog.previewAction(path, ActionType.MIGRATE);
// after
PreviewResult r = ActionType.MIGRATE == action ? null : catalog.previewAction(path, action); // guard unsupported types first
Defensive patterns

Strategy: try-catch

Validate before calling

Set<ActionType> supported = Set.of(CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, CREATE_DATABASE, DROP_DATABASE);
if (!supported.contains(actionType)) { /* skip preview */ }

Try / catch

try { return catalog.previewAction(path, action); } catch (UnsupportedOperationException e) { return new InfoPreviewResult("preview not supported"); }

Prevention

When it happens

Trigger: Calling previewAction(tablePath, action) with an ActionType not implemented in the connector (e.g. newly added engine action types the Iceberg catalog has no preview branch for).

Common situations: Newer SeaTunnel versions introduce new action types while the Iceberg catalog module lags; code dynamically dispatching action types without checking supported ones first.

Related errors


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