{"record":{"id":"dfe5ec46499a8087","repo":"apache/seatunnel","slug":"unsupported-action-type","errorCode":null,"errorMessage":"Unsupported action type: ","messagePattern":"Unsupported action type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseCatalog.java","lineNumber":277,"sourceCode":"                            catalogTable.get().getTableSchema(),\n                            catalogTable.get().getComment(),\n                            ClickhouseSinkOptions.SAVE_MODE_CREATE_TEMPLATE.key()));\n        } else if (actionType == ActionType.DROP_TABLE) {\n            return new SQLPreviewResult(\n                    ClickhouseCatalogUtil.INSTANCE.getDropTableSql(tablePath, true));\n        } else if (actionType == ActionType.TRUNCATE_TABLE) {\n            return new SQLPreviewResult(\n                    ClickhouseCatalogUtil.INSTANCE.getTruncateTableSql(tablePath));\n        } else if (actionType == ActionType.CREATE_DATABASE) {\n            return new SQLPreviewResult(\n                    ClickhouseCatalogUtil.INSTANCE.getCreateDatabaseSql(\n                            tablePath.getDatabaseName(), true));\n        } else if (actionType == ActionType.DROP_DATABASE) {\n            return new SQLPreviewResult(\n                    ClickhouseCatalogUtil.INSTANCE.getDropDatabaseSql(\n                            tablePath.getDatabaseName(), true));\n        } else {\n            throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n        }\n    }\n}\n","sourceCodeStart":259,"sourceCodeEnd":281,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-clickhouse/src/main/java/org/apache/seatunnel/connectors/seatunnel/clickhouse/catalog/ClickhouseCatalog.java#L259-L281","documentation":"ClickhouseCatalog.previewAction executes one of several supported DDL preview actions (CREATE/DROP TABLE, CREATE/DROP DATABASE). If the caller passes an ActionType the catalog does not implement (anything other than those four), it throws UnsupportedOperationException with the offending ActionType. It signals an unhandled/unsupported catalog operation rather than a config or SQL problem.","triggerScenarios":"Calling SeaTunnelCatalog.previewAction on a ClickhouseCatalog with an ActionType that is not CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, or DROP_DATABASE — e.g. TRUNCATE_TABLE or a newly added ActionType the Clickhouse connector has not implemented.","commonSituations":"Engine or tooling code iterates over all ActionType values generically and calls previewAction for each; a new ActionType added upstream before ClickhouseCatalog supports it; user tooling invoking unsupported DDL preview through the catalog API.","solutions":["Only call previewAction with the four ActionTypes ClickhouseCatalog supports (CREATE_TABLE, DROP_TABLE, CREATE_DATABASE, DROP_DATABASE).","Catch UnsupportedOperationException and handle unsupported actions gracefully (skip or show 'not supported' in tooling).","Check the ClickhouseCatalog source for the supported set before adding new ActionType usage, and implement the missing branch in previewAction if you need it.","Upgrade the connector to a version that implements the ActionType you need, if newer releases added it."],"exampleFix":"// before\nSQLPreviewResult result = catalog.previewAction(ActionType.TRUNCATE_TABLE, ...);\n// after\nif (actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE\n        || actionType == ActionType.CREATE_DATABASE || actionType == ActionType.DROP_DATABASE) {\n    SQLPreviewResult result = catalog.previewAction(actionType, ...);\n} else {\n    throw new UnsupportedOperationException(\"Clickhouse catalog does not support: \" + actionType);\n}","handlingStrategy":"try-catch","validationCode":"private static final Set<ActionType> SUPPORTED = Set.of(ActionType.CREATE_TABLE, ActionType.DROP_TABLE, ActionType.CREATE_DATABASE, ActionType.DROP_DATABASE);\nif (!SUPPORTED.contains(actionType)) { throw new IllegalArgumentException(\"ClickhouseCatalog does not support \" + actionType); }","typeGuard":"boolean supported = actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE || actionType == ActionType.CREATE_DATABASE || actionType == ActionType.DROP_DATABASE;","tryCatchPattern":"try { result = catalog.previewAction(actionType, sql, params); } catch (UnsupportedOperationException e) { log.warn(\"Clickhouse catalog does not support preview for {}: {}\", actionType, e.getMessage()); result = null; }","preventionTips":["Enumerate the supported ActionTypes from the catalog implementation before generic iteration.","When upstream adds a new ActionType, audit every catalog implementation for a matching branch.","Centralize DDL preview calls in one helper that handles unsupported actions uniformly."],"tags":["clickhouse","catalog","unsupported-action","ddl"],"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"}