{"record":{"id":"f0e886e82b8cdc08","repo":"apache/seatunnel","slug":"unsupported-action-type-actiontype-f0e886","errorCode":null,"errorMessage":"Unsupported action type: ${actionType}","messagePattern":"Unsupported action type: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/catalog/EasysearchCatalog.java","lineNumber":281,"sourceCode":"    }\n\n    @Override\n    public PreviewResult previewAction(\n            ActionType actionType,\n            TablePath tablePath,\n            java.util.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    private Map<String, String> buildTableOptions(TablePath tablePath) {\n        Map<String, String> options = new HashMap<>();\n        options.put(\"connector\", \"easysearch\");\n        // todo: Right now, we don't use the config in the plugin config, do we need to add\n        // bootstrap servers here?\n        options.put(\"config\", ConfigUtil.convertToJsonString(tablePath));\n        return options;\n    }\n}\n","sourceCodeStart":263,"sourceCodeEnd":294,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/catalog/EasysearchCatalog.java#L263-L294","documentation":"EasysearchCatalog.previewAction only knows how to describe CREATE_TABLE, DROP_TABLE, CREATE_DATABASE and DROP_DATABASE actions; any other ActionType reaches the else branch and throws UnsupportedOperationException.","triggerScenarios":"Calling previewAction with an ActionType other than the four handled ones, e.g. TRUNCATE_TABLE or any newly added ActionType enum value not yet wired into the preview logic.","commonSituations":"Job configs using truncate/other auto-create actions whose preview is requested; upgrading SeaTunnel adds a new ActionType while the connector's preview switch lags behind.","solutions":["Only request previews for supported actions (create/drop table or database).","Skip or special-case preview for unsupported action types in your tooling.","Update previewAction to handle the missing ActionType (e.g. TRUNCATE_TABLE) if you maintain the connector."],"exampleFix":"// before\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// after\n} else if (actionType == ActionType.TRUNCATE_TABLE) {\n    return new InfoPreviewResult(\"delete and create index \" + tablePath.getTableName());\n} else {\n    throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n}","handlingStrategy":"validation","validationCode":"Set<ActionType> supported = EnumSet.of(ActionType.CREATE_TABLE, ActionType.DROP_TABLE,\n    ActionType.CREATE_DATABASE, ActionType.DROP_DATABASE);\nif (!supported.contains(actionType)) {\n    throw new IllegalArgumentException(\"Preview not supported for \" + actionType);\n}","typeGuard":null,"tryCatchPattern":"try {\n    result = catalog.previewAction(actionType, tablePath, ignoreIfNotExists);\n} catch (UnsupportedOperationException e) {\n    // skip preview or fall back to generic description\n}","preventionTips":["Only preview the four supported ActionTypes","Handle new enum values after SeaTunnel upgrades","Feature-detect supported actions in tooling"],"tags":["easysearch","catalog","unsupported-action"],"backgroundTag":"unsupported-enum-value","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"}