{"record":{"id":"ae131b33044a03cb","repo":"apache/seatunnel","slug":"unsupported-action-type-ae131b","errorCode":null,"errorMessage":"Unsupported action type: ","messagePattern":"Unsupported action type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/catalog/ElasticSearchCatalog.java","lineNumber":270,"sourceCode":"        options.put(\"config\", ConfigUtil.convertToJsonString(tablePath));\n        return options;\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 index \" + tablePath.getTableName());\n        } else if (actionType == ActionType.DROP_TABLE) {\n            return new InfoPreviewResult(\"delete index \" + tablePath.getTableName());\n        } else if (actionType == ActionType.TRUNCATE_TABLE) {\n            return new InfoPreviewResult(\"delete and create index \" + tablePath.getTableName());\n        } else if (actionType == ActionType.CREATE_DATABASE) {\n            return new InfoPreviewResult(\"create index \" + tablePath.getTableName());\n        } else if (actionType == ActionType.DROP_DATABASE) {\n            return new InfoPreviewResult(\"delete index \" + tablePath.getTableName());\n        } else {\n            throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n        }\n    }\n}\n","sourceCodeStart":252,"sourceCodeEnd":274,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/catalog/ElasticSearchCatalog.java#L252-L274","documentation":"ElasticSearchCatalog.previewAction only supports a fixed set of ActionType values (create table, drop table, create database, drop database). When called with any other ActionType (e.g. a bulk or rename action the Elasticsearch catalog does not implement), it throws UnsupportedOperationException with the unhandled action type in the message. This is a programming/contract error, not a runtime environment problem.","triggerScenarios":"Calling previewAction(TablePath, ActionType) with an ActionType not handled by the if/else chain — typically Action TYPE types added by newer API versions or actions like RENAME_TABLE passed to the Elasticsearch catalog.","commonSituations":"Framework or engine invoking preview for an action the Elasticsearch catalog never implemented; code updated to a new SeaTunnel API adding new ActionTypes without updating this catalog; user code passing an unsupported action programmatically.","solutions":["Check the ActionType being passed; only CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE are supported","Update the caller to skip previewAction for unsupported ActionTypes","If a new ActionType exists in your API version, add a branch to previewAction handling it","Align SeaTunnel API and connector versions so the caller does not emit ActionTypes this catalog version lacks"],"exampleFix":"// before\nthrow new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n// after\n} else if (actionType == ActionType.ADD_COLUMN) {\n    return new InfoPreviewResult(\"add column to index \" + tablePath.getTableName());\n} else {\n    return new InfoPreviewResult(\"unsupported action \" + actionType); // or handle explicitly\n}","handlingStrategy":"type-guard","validationCode":"Set<ActionType> SUPPORTED = EnumSet.of(CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE); if (!SUPPORTED.contains(actionType)) { skip or throw expected error };","typeGuard":"boolean isSupported(ActionType t) { return t == ActionType.CREATE_TABLE || t == ActionType.DROP_TABLE || t == ActionType.CREATE_DATABASE || t == ActionType.DROP_DATABASE; }","tryCatchPattern":"try { preview = catalog.previewAction(tablePath, actionType); } catch (UnsupportedOperationException e) { LOG.warn(\"Preview unsupported for \" + actionType); preview = null; }","preventionTips":["Only pass CREATE_TABLE/DROP_TABLE/CREATE_DATABASE/DROP_DATABASE to the ES catalog","Gate preview calls behind a capability check per catalog implementation","When upgrading the SeaTunnel API, re-check for new ActionTypes"],"tags":["elasticsearch","catalog","unsupported-action","preview"],"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"}