apache/seatunnel · warning · UnsupportedOperationException

Preview action is not supported

Error message

Preview action is not supported

What it means

Catalog.previewAction is a default method that throws UnsupportedOperationException because not every catalog implementation can preview the SQL/result of an action (CREATE/DROP etc.) without executing it. Catalogs that support preview must override it.

Source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/Catalog.java:372

     * @param tablePath Path of the table
     * @param ignoreIfNotExists Flag to specify behavior when a table with the given name doesn't
     *     exist
     * @throws TableNotExistException thrown if the table doesn't exist in the catalog and
     *     ignoreIfNotExists is false
     * @throws CatalogException in case of any runtime exception
     */
    default void truncateTable(TablePath tablePath, boolean ignoreIfNotExists)
            throws TableNotExistException, CatalogException {}

    default boolean isExistsData(TablePath tablePath) {
        return false;
    }

    default void executeSql(TablePath tablePath, String sql) {}

    default PreviewResult previewAction(
            ActionType actionType, TablePath tablePath, Optional<CatalogTable> catalogTable) {
        throw new UnsupportedOperationException("Preview action is not supported");
    }

    enum ActionType {
        CREATE_TABLE,
        CREATE_DATABASE,
        DROP_TABLE,
        DROP_DATABASE,
        TRUNCATE_TABLE
    }

    // todo: Support for update table metadata

}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check catalog capability before calling previewAction and surface a 'preview not supported' message instead of failing
  2. Implement previewAction in the custom Catalog to return a PreviewResult
  3. Use a catalog implementation that supports preview

Example fix

// before
catalog.previewAction(ActionType.CREATE_TABLE, tablePath, Optional.of(ct));
// after
try {
    result = catalog.previewAction(ActionType.CREATE_TABLE, tablePath, Optional.of(ct));
} catch (UnsupportedOperationException e) {
    // fall back to skip preview
}
Defensive patterns

Strategy: try-catch

Try / catch

try { result = catalog.previewAction(type, path, ct); } catch (UnsupportedOperationException e) { /* preview unsupported; skip */ }

Prevention

When it happens

Trigger: Calling previewAction(...) (e.g. from previewResult or a UI/REST preview flow) on a catalog implementation (e.g. a basic connector catalog) that has not overridden the default method.

Common situations: Invoking schema-change preview from the web UI or API against a connector whose Catalog lacks preview support; using preview features on catalogs that only implement executeSql.

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