apache/seatunnel · error · UnsupportedOperationException

Unsupported action type:

Error message

Unsupported action type: 

What it means

ElasticSearchCatalog.previewAction only supports a fixed set of ActionType values (create table, drop table, create database, drop database). When called with any other ActionType (e.g. a bulk or rename action the Elasticsearch catalog does not implement), it throws UnsupportedOperationException with the unhandled action type in the message. This is a programming/contract error, not a runtime environment problem.

Source

Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/catalog/ElasticSearchCatalog.java:270

        options.put("config", ConfigUtil.convertToJsonString(tablePath));
        return options;
    }

    @Override
    public PreviewResult previewAction(
            ActionType actionType, TablePath tablePath, Optional<CatalogTable> catalogTable) {
        if (actionType == ActionType.CREATE_TABLE) {
            return new InfoPreviewResult("create index " + tablePath.getTableName());
        } else if (actionType == ActionType.DROP_TABLE) {
            return new InfoPreviewResult("delete index " + tablePath.getTableName());
        } else if (actionType == ActionType.TRUNCATE_TABLE) {
            return new InfoPreviewResult("delete and create index " + tablePath.getTableName());
        } else if (actionType == ActionType.CREATE_DATABASE) {
            return new InfoPreviewResult("create index " + tablePath.getTableName());
        } else if (actionType == ActionType.DROP_DATABASE) {
            return new InfoPreviewResult("delete index " + tablePath.getTableName());
        } else {
            throw new UnsupportedOperationException("Unsupported action type: " + actionType);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the ActionType being passed; only CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE are supported
  2. Update the caller to skip previewAction for unsupported ActionTypes
  3. If a new ActionType exists in your API version, add a branch to previewAction handling it
  4. Align SeaTunnel API and connector versions so the caller does not emit ActionTypes this catalog version lacks

Example fix

// before
throw new UnsupportedOperationException("Unsupported action type: " + actionType);
// after
} else if (actionType == ActionType.ADD_COLUMN) {
    return new InfoPreviewResult("add column to index " + tablePath.getTableName());
} else {
    return new InfoPreviewResult("unsupported action " + actionType); // or handle explicitly
}
Defensive patterns

Strategy: type-guard

Validate before calling

Set<ActionType> SUPPORTED = EnumSet.of(CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE); if (!SUPPORTED.contains(actionType)) { skip or throw expected error };

Type guard

boolean isSupported(ActionType t) { return t == ActionType.CREATE_TABLE || t == ActionType.DROP_TABLE || t == ActionType.CREATE_DATABASE || t == ActionType.DROP_DATABASE; }

Try / catch

try { preview = catalog.previewAction(tablePath, actionType); } catch (UnsupportedOperationException e) { LOG.warn("Preview unsupported for " + actionType); preview = null; }

Prevention

When it happens

Trigger: Calling previewAction(TablePath, ActionType) with an ActionType not handled by the if/else chain — typically Action TYPE types added by newer API versions or actions like RENAME_TABLE passed to the Elasticsearch catalog.

Common situations: Framework or engine invoking preview for an action the Elasticsearch catalog never implemented; code updated to a new SeaTunnel API adding new ActionTypes without updating this catalog; user code passing an unsupported action programmatically.

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/ae131b33044a03cb. Report an issue: GitHub.