apache/seatunnel · error · UnsupportedOperationException

Unsupported action type: {actionType}

Error message

Unsupported action type: {actionType}

What it means

DorisCatalog.previewAction only supports previewing CREATE_DATABASE and DROP_DATABASE actions; any other ActionType reaches the final else and throws UnsupportedOperationException. This is a guard against preview requests for action types DorisCatalog has not implemented.

Source

Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/catalog/DorisCatalog.java:540

            return new SQLPreviewResult(
                    DorisCatalogUtil.getCreateTableStatement(
                            createTableTemplate,
                            tablePath,
                            catalogTable.get(),
                            // used for test when typeConverter is null
                            typeConverter != null ? typeConverter : DorisTypeConverterV2.INSTANCE));
        } else if (actionType == ActionType.DROP_TABLE) {
            return new SQLPreviewResult(DorisCatalogUtil.getDropTableQuery(tablePath, true));
        } else if (actionType == ActionType.TRUNCATE_TABLE) {
            return new SQLPreviewResult(DorisCatalogUtil.getTruncateTableQuery(tablePath));
        } else if (actionType == ActionType.CREATE_DATABASE) {
            return new SQLPreviewResult(
                    DorisCatalogUtil.getCreateDatabaseQuery(tablePath.getDatabaseName(), true));
        } else if (actionType == ActionType.DROP_DATABASE) {
            return new SQLPreviewResult(
                    DorisCatalogUtil.getDropDatabaseQuery(tablePath.getDatabaseName(), true));
        } else {
            throw new UnsupportedOperationException("Unsupported action type: " + actionType);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Only call previewAction with ActionType.CREATE_DATABASE or ActionType.DROP_DATABASE
  2. Add a branch in previewAction for the desired ActionType that returns the corresponding SQLPreviewResult
  3. Check the ActionType value passed by your caller before invoking

Example fix

// before
SQLPreviewResult r = catalog.previewAction(ActionType.CREATE_TABLE, tablePath, Optional.empty());
// after
SQLPreviewResult r = ActionType.CREATE_DATABASE == actionType || ActionType.DROP_DATABASE == actionType
        ? catalog.previewAction(actionType, tablePath, Optional.empty())
        : null; // CREATE_TABLE preview is unsupported for Doris catalog
Defensive patterns

Strategy: validation

Validate before calling

Set<ActionType> supported = EnumSet.of(ActionType.CREATE_DATABASE, ActionType.DROP_DATABASE);
if (!supported.contains(actionType)) {
    throw new IllegalArgumentException("previewAction supports only CREATE_DATABASE/DROP_DATABASE, got: " + actionType);
}

Type guard

boolean previewSupported(ActionType t) {
    return t == ActionType.CREATE_DATABASE || t == ActionType.DROP_DATABASE;
}

Prevention

When it happens

Trigger: Calling catalog.previewAction(actionType, tablePath, catalogTable) with any ActionType other than CREATE_DATABASE or DROP_DATABASE (e.g. CREATE_TABLE, DROP_TABLE, truncation actions).

Common situations: Tooling or UI code that iterates over all ActionType values and previews each; new ActionType enum values added upstream but not yet handled by the Doris catalog.

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