apache/seatunnel · error · UnsupportedOperationException
Unsupported action type:
Error message
Unsupported action type:
What it means
TypesenseCatalog.previewAction() generates a human-readable preview of a catalog action (create/drop database or table). If the ActionType passed is not one of the four handled values (CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE), it throws UnsupportedOperationException with the unsupported action type appended.
Source
Thrown at seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/catalog/TypesenseCatalog.java:220
return typesenseClient.collectionDocNum(tablePath.getTableName()) > 0;
}
@Override
public PreviewResult previewAction(
ActionType actionType, TablePath tablePath, Optional<CatalogTable> catalogTable) {
if (actionType == ActionType.CREATE_TABLE) {
return new InfoPreviewResult("create collection " + tablePath.getTableName());
} else if (actionType == ActionType.DROP_TABLE) {
return new InfoPreviewResult("delete collection " + tablePath.getTableName());
} else if (actionType == ActionType.TRUNCATE_TABLE) {
return new InfoPreviewResult(
"delete and create collection " + tablePath.getTableName());
} else if (actionType == ActionType.CREATE_DATABASE) {
return new InfoPreviewResult("create collection " + tablePath.getTableName());
} else if (actionType == ActionType.DROP_DATABASE) {
return new InfoPreviewResult("delete collection " + tablePath.getTableName());
} else {
throw new UnsupportedOperationException("Unsupported action type: " + actionType);
}
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Only pass the four supported ActionTypes (CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE) to previewAction for Typesense
- Wrap previewAction in a try-catch for UnsupportedOperationException and handle unsupported actions upstream before calling
- Add a branch for the desired ActionType in TypesenseCatalog.previewAction to return an appropriate InfoPreviewResult
- Upgrade to a connector version that handles the needed ActionType
Example fix
// before
catalog.previewAction(ActionType.TRUNCATE_TABLE, tablePath); // throws UnsupportedOperationException
// after
if (actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE
|| actionType == ActionType.CREATE_DATABASE || actionType == ActionType.DROP_DATABASE) {
catalog.previewAction(actionType, tablePath);
} Defensive patterns
Strategy: validation
Validate before calling
if (actionType != ActionType.CREATE_TABLE && actionType != ActionType.DROP_TABLE
&& actionType != ActionType.CREATE_DATABASE && actionType != ActionType.DROP_DATABASE) {
throw new IllegalArgumentException("Typesense catalog does not support action: " + actionType);
} Type guard
boolean isSupportedCatalogAction(ActionType t) {
return t == ActionType.CREATE_TABLE || t == ActionType.DROP_TABLE
|| t == ActionType.CREATE_DATABASE || t == ActionType.DROP_DATABASE;
} Try / catch
try {
result = catalog.previewAction(actionType, tablePath);
} catch (UnsupportedOperationException e) {
// handle unsupported preview: skip or surface a friendly message
} Prevention
- Restrict catalog actions dispatched to Typesense to create/drop table and database
- Check the connector's supported ActionType set before invoking preview
- When extending the enum, audit every catalog implementation for exhaustive handling
When it happens
Trigger: Calling TypesenseCatalog.previewAction(ActionType) with any ActionType other than CREATE_TABLE, DROP_TABLE, CREATE_DATABASE or DROP_DATABASE — e.g. with an engine-driven action like TRUNCATE_TABLE or a future/unknown enum constant.
Common situations: A pipeline or tool previews every ActionType in the enum against a Typesense catalog; automation invoking truncate or alter operations on a Typesense catalog that only supports collection create/drop semantics.
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
- Unsupported action type: {actionType}
- Unsupported action type: ${actionType}
- Hudi catalog not support truncate table.
- Unsupported action type: ${actionType}
- Unsupported action type:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/eb9ae3cea59aa36b.
Report an issue: GitHub.