{"record":{"id":"0790927115e43bb2","repo":"apache/seatunnel","slug":"unsupported-action-type-079092","errorCode":null,"errorMessage":"Unsupported action type: ","messagePattern":"Unsupported action type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/catalog/IcebergCatalog.java","lineNumber":365,"sourceCode":"        return null;\n    }\n\n    @Override\n    public PreviewResult previewAction(\n            ActionType actionType, TablePath tablePath, Optional<CatalogTable> catalogTable) {\n        if (actionType == ActionType.CREATE_TABLE) {\n            checkArgument(catalogTable.isPresent(), \"CatalogTable cannot be null\");\n            return new InfoPreviewResult(\"create table \" + toIcebergTableIdentifier(tablePath));\n        } else if (actionType == ActionType.DROP_TABLE) {\n            return new InfoPreviewResult(\"drop table \" + toIcebergTableIdentifier(tablePath));\n        } else if (actionType == ActionType.TRUNCATE_TABLE) {\n            return new InfoPreviewResult(\"truncate table \" + toIcebergTableIdentifier(tablePath));\n        } else if (actionType == ActionType.CREATE_DATABASE) {\n            return new InfoPreviewResult(\"do nothing\");\n        } else if (actionType == ActionType.DROP_DATABASE) {\n            return new InfoPreviewResult(\"do nothing\");\n        } else {\n            throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n        }\n    }\n}\n","sourceCodeStart":347,"sourceCodeEnd":369,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/catalog/IcebergCatalog.java#L347-L369","documentation":"Thrown by IcebergCatalog.previewAction when the requested ActionType is not one of the handled preview actions (CREATE_TABLE, DROP_TABLE, etc.) — an unhandled enum branch in the action-type switch, i.e. an unsupported catalog action preview.","triggerScenarios":"Calling previewAction(tablePath, action) with an ActionType not implemented in the connector (e.g. newly added engine action types the Iceberg catalog has no preview branch for).","commonSituations":"Newer SeaTunnel versions introduce new action types while the Iceberg catalog module lags; code dynamically dispatching action types without checking supported ones first.","solutions":["Only invoke previewAction with supported action types (CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, CREATE_DATABASE, DROP_DATABASE).","Upgrade the connector module so it covers the new ActionType.","Handle UnsupportedOperationException at the call site and fall back to a generic preview message.","Add a branch for the missing ActionType in IcebergCatalog.previewAction."],"exampleFix":"// before\nPreviewResult r = catalog.previewAction(path, ActionType.MIGRATE);\n// after\nPreviewResult r = ActionType.MIGRATE == action ? null : catalog.previewAction(path, action); // guard unsupported types first","handlingStrategy":"try-catch","validationCode":"Set<ActionType> supported = Set.of(CREATE_TABLE, DROP_TABLE, TRUNCATE_TABLE, CREATE_DATABASE, DROP_DATABASE);\nif (!supported.contains(actionType)) { /* skip preview */ }","typeGuard":null,"tryCatchPattern":"try { return catalog.previewAction(path, action); } catch (UnsupportedOperationException e) { return new InfoPreviewResult(\"preview not supported\"); }","preventionTips":["Whitelist action types before previewing","Keep the connector module version in sync with the engine","Test preview for each ActionType used"],"tags":["iceberg","catalog","unsupported-action","enum"],"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-14T05:17:10.506Z"}