{"record":{"id":"4a37671dd0a78497","repo":"apache/seatunnel","slug":"unsupported-action-type-4a3767","errorCode":null,"errorMessage":"Unsupported action type: ","messagePattern":"Unsupported action type: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/catalog/MilvusCatalog.java","lineNumber":127,"sourceCode":"\n    @Override\n    public String name() {\n        return catalogName;\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 collection \" + tablePath.getTableName());\n        } else if (actionType == ActionType.DROP_TABLE) {\n            return new InfoPreviewResult(\"drop collection \" + tablePath.getTableName());\n        } else if (actionType == ActionType.CREATE_DATABASE) {\n            return new InfoPreviewResult(\"create database \" + tablePath.getDatabaseName());\n        } else if (actionType == ActionType.DROP_DATABASE) {\n            return new InfoPreviewResult(\"drop database \" + tablePath.getDatabaseName());\n        } else {\n            throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n        }\n    }\n\n    @Override\n    public String getDefaultDatabase() throws CatalogException {\n        return \"default\";\n    }\n\n    @Override\n    public boolean databaseExists(String databaseName) throws CatalogException {\n        List<String> databases = this.listDatabases();\n        return databases.contains(databaseName);\n    }\n\n    @Override\n    public List<String> listDatabases() throws CatalogException {\n        R<ListDatabasesResponse> response = this.client.listDatabases();\n        return response.getData().getDbNamesList();","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-milvus/src/main/java/org/apache/seatunnel/connectors/seatunnel/milvus/catalog/MilvusCatalog.java#L109-L145","documentation":"MilvusCatalog.previewAction computes a human-readable preview for supported catalog actions (create/drop table/collection, create/drop database). An ActionType outside these branches throws UnsupportedOperationException with 'Unsupported action type: <action>'. This is a completeness guard, meaning the preview feature does not cover that action.","triggerScenarios":"Calling catalog.previewAction(tablePath, actionType) with an ActionType not handled by MilvusCatalog (e.g. a newer action enum added by the catalog API that Milvus has no preview branch for, or a caller passing an unexpected action).","commonSituations":"Future-facing catalog code invoking preview with action types added after this Milvus implementation was written; plugin/framework callers enumerating all ActionType values against catalogs that don't support all of them.","solutions":["Only invoke previewAction with actions Milvus supports (create/drop table, create/drop database).","Extend MilvusCatalog.previewAction with a branch for the missing ActionType if it is a legitimate new action.","Check the SeaTunnel version: update Milvus connector to a release where the missing action is handled."],"exampleFix":"// before\nthrow new UnsupportedOperationException(\"Unsupported action type: \" + actionType);\n// after\n} else if (actionType == ActionType.TRUNCATE_TABLE) {\n    return new InfoPreviewResult(\"truncate collection \" + tablePath.getTableName());\n} else {\n    throw new UnsupportedOperationException(\"Unsupported action type: \" + actionType);","handlingStrategy":"type-guard","validationCode":"if (actionType != ActionType.CREATE_TABLE && actionType != ActionType.DROP_TABLE\n    && actionType != ActionType.CREATE_DATABASE && actionType != ActionType.DROP_DATABASE) {\n    throw new IllegalArgumentException(\"Milvus catalog does not support preview for \" + actionType);\n}","typeGuard":"boolean isPreviewableByMilvus(ActionType t) {\n    return t == ActionType.CREATE_TABLE || t == ActionType.DROP_TABLE\n        || t == ActionType.CREATE_DATABASE || t == ActionType.DROP_DATABASE;\n}","tryCatchPattern":"try {\n    result = milvusCatalog.previewAction(tablePath, actionType);\n} catch (UnsupportedOperationException e) {\n    log.warn(\"No preview available for {} on Milvus: {}\", actionType, e.getMessage());\n    result = new InfoPreviewResult(\"(preview unsupported for \" + actionType + \")\");\n}","preventionTips":["Guard ActionType against Milvus-supported set before calling previewAction","Update the Milvus connector when new ActionType values are introduced in the catalog API"],"tags":["milvus","catalog","unsupported-operation","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-14T11:17:12.474Z"}