{"record":{"id":"eb9ae3cea59aa36b","repo":"apache/seatunnel","slug":"unsupported-action-type-eb9ae3","errorCode":null,"errorMessage":"Unsupported action type: ","messagePattern":"Unsupported action type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/catalog/TypesenseCatalog.java","lineNumber":220,"sourceCode":"        return typesenseClient.collectionDocNum(tablePath.getTableName()) > 0;\n    }\n\n    @Override\n    public PreviewResult previewAction(\n            ActionType actionType, TablePath tablePath, Optional<CatalogTable> catalogTable) {\n        if (actionType == ActionType.CREATE_TABLE) {\n            return new InfoPreviewResult(\"create collection \" + tablePath.getTableName());\n        } else if (actionType == ActionType.DROP_TABLE) {\n            return new InfoPreviewResult(\"delete collection \" + tablePath.getTableName());\n        } else if (actionType == ActionType.TRUNCATE_TABLE) {\n            return new InfoPreviewResult(\n                    \"delete and create collection \" + tablePath.getTableName());\n        } else if (actionType == ActionType.CREATE_DATABASE) {\n            return new InfoPreviewResult(\"create collection \" + tablePath.getTableName());\n        } else if (actionType == ActionType.DROP_DATABASE) {\n            return new InfoPreviewResult(\"delete collection \" + tablePath.getTableName());\n        } else {\n            throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n        }\n    }\n}\n","sourceCodeStart":202,"sourceCodeEnd":224,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/catalog/TypesenseCatalog.java#L202-L224","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\ncatalog.previewAction(ActionType.TRUNCATE_TABLE, tablePath); // throws UnsupportedOperationException\n// after\nif (actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE\n        || actionType == ActionType.CREATE_DATABASE || actionType == ActionType.DROP_DATABASE) {\n    catalog.previewAction(actionType, tablePath);\n}","handlingStrategy":"validation","validationCode":"if (actionType != ActionType.CREATE_TABLE && actionType != ActionType.DROP_TABLE\n        && actionType != ActionType.CREATE_DATABASE && actionType != ActionType.DROP_DATABASE) {\n    throw new IllegalArgumentException(\"Typesense catalog does not support action: \" + actionType);\n}","typeGuard":"boolean isSupportedCatalogAction(ActionType t) {\n    return t == ActionType.CREATE_TABLE || t == ActionType.DROP_TABLE\n        || t == ActionType.CREATE_DATABASE || t == ActionType.DROP_DATABASE;\n}","tryCatchPattern":"try {\n    result = catalog.previewAction(actionType, tablePath);\n} catch (UnsupportedOperationException e) {\n    // handle unsupported preview: skip or surface a friendly message\n}","preventionTips":["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"],"tags":["unsupported-operation","catalog","typesense"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}