{"record":{"id":"841f936c70802308","repo":"apache/seatunnel","slug":"preview-action-is-not-supported","errorCode":null,"errorMessage":"Preview action is not supported","messagePattern":"Preview action is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/Catalog.java","lineNumber":372,"sourceCode":"     * @param tablePath Path of the table\n     * @param ignoreIfNotExists Flag to specify behavior when a table with the given name doesn't\n     *     exist\n     * @throws TableNotExistException thrown if the table doesn't exist in the catalog and\n     *     ignoreIfNotExists is false\n     * @throws CatalogException in case of any runtime exception\n     */\n    default void truncateTable(TablePath tablePath, boolean ignoreIfNotExists)\n            throws TableNotExistException, CatalogException {}\n\n    default boolean isExistsData(TablePath tablePath) {\n        return false;\n    }\n\n    default void executeSql(TablePath tablePath, String sql) {}\n\n    default PreviewResult previewAction(\n            ActionType actionType, TablePath tablePath, Optional<CatalogTable> catalogTable) {\n        throw new UnsupportedOperationException(\"Preview action is not supported\");\n    }\n\n    enum ActionType {\n        CREATE_TABLE,\n        CREATE_DATABASE,\n        DROP_TABLE,\n        DROP_DATABASE,\n        TRUNCATE_TABLE\n    }\n\n    // todo: Support for update table metadata\n\n}\n","sourceCodeStart":354,"sourceCodeEnd":386,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/Catalog.java#L354-L386","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check catalog capability before calling previewAction and surface a 'preview not supported' message instead of failing","Implement previewAction in the custom Catalog to return a PreviewResult","Use a catalog implementation that supports preview"],"exampleFix":"// before\ncatalog.previewAction(ActionType.CREATE_TABLE, tablePath, Optional.of(ct));\n// after\ntry {\n    result = catalog.previewAction(ActionType.CREATE_TABLE, tablePath, Optional.of(ct));\n} catch (UnsupportedOperationException e) {\n    // fall back to skip preview\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { result = catalog.previewAction(type, path, ct); } catch (UnsupportedOperationException e) { /* preview unsupported; skip */ }","preventionTips":["Check catalog docs for preview support","Gate preview UI behind capability flags","Override previewAction in custom catalogs"],"tags":["catalog","preview","sql"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}