{"record":{"id":"33f1ccb01c1c4e61","repo":"apache/seatunnel","slug":"unsupported-action-type-actiontype-33f1cc","errorCode":null,"errorMessage":"Unsupported action type: ${actionType}","messagePattern":"Unsupported action type: (.+?)","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/catalog/MaxComputeCatalog.java","lineNumber":319,"sourceCode":"        } catch (OdpsException e) {\n            throw new CatalogException(\"execute sql error\", e);\n        }\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 SQLPreviewResult(\n                    MaxComputeCatalogUtil.getCreateTableStatement(\n                            readonlyConfig.get(MaxcomputeSinkOptions.SAVE_MODE_CREATE_TEMPLATE),\n                            tablePath,\n                            catalogTable.get()));\n        } else if (actionType == ActionType.DROP_TABLE) {\n            return new SQLPreviewResult(MaxComputeCatalogUtil.getDropTableQuery(tablePath, true));\n        } else {\n            throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n        }\n    }\n\n    /**\n     * Creates an ODPS client for the given project. When {@code schemaName} is non-blank, sets it\n     * as the current schema so that subsequent ODPS API calls resolve tables within that MaxCompute\n     * Schema namespace.\n     */\n    private Odps getOdps(String project) {\n        return getOdps(project, null);\n    }\n\n    private Odps getOdps(String project, String schemaName) {\n        Odps odps = new Odps(account);\n        odps.setEndpoint(readonlyConfig.get(MaxcomputeBaseOptions.ENDPOINT));\n        odps.setDefaultProject(project);\n        if (StringUtils.isNotEmpty(schemaName)) {\n            odps.setCurrentSchema(schemaName);","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/catalog/MaxComputeCatalog.java#L301-L337","documentation":"previewAction only supports CREATE_TABLE, DROP_TABLE (and CREATE/alter paths via templates); any other ActionType hits the else branch and throws UnsupportedOperationException. This is a capability limitation of the MaxCompute catalog's preview implementation, not a data error.","triggerScenarios":"Calling catalog.previewAction with an unsupported ActionType such as TRUNCATE_TABLE or other action types on MaxcomputeCatalog.","commonSituations":"Generic save-mode automation that previews every action type for all catalogs without checking which actions the MaxCompute catalog supports; new action types added upstream but not implemented in this connector.","solutions":["Only call previewAction for ActionType.CREATE_TABLE and DROP_TABLE on this catalog","Handle/absorb UnsupportedOperationException at the call site and skip preview for unsupported actions","Upgrade SeaTunnel/connector version in case support for more action types was added","Extend previewAction in MaxComputeCatalog if you need new previews"],"exampleFix":"// before\nPreviewResult r = catalog.previewAction(actionType, tablePath, Optional.of(table));\n// after\nPreviewResult r = (actionType == ActionType.CREATE_TABLE || actionType == ActionType.DROP_TABLE)\n        ? catalog.previewAction(actionType, tablePath, Optional.of(table))\n        : null;","handlingStrategy":"validation","validationCode":"Set<ActionType> supported = EnumSet.of(ActionType.CREATE_TABLE, ActionType.DROP_TABLE);\nif (!supported.contains(actionType)) {\n    throw new IllegalArgumentException(\"preview unsupported for \" + actionType);\n}","typeGuard":null,"tryCatchPattern":"try { return catalog.previewAction(actionType, tablePath, ct); }\ncatch (UnsupportedOperationException e) { return null; // skip preview }","preventionTips":["Only preview CREATE_TABLE/DROP_TABLE for MaxCompute","Check catalog capabilities before generic action automation","Keep connector version current for newly supported action types"],"tags":["maxcompute","catalog","unsupported-operation","preview"],"backgroundTag":"operation-not-supported","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"}