{"record":{"id":"94ae8752a9de9fe3","repo":"apache/seatunnel","slug":"invalid-indextype-s-for-column-s-valid-valu","errorCode":null,"errorMessage":"Invalid indexType '%s' for column '%s'. Valid values are: %s","messagePattern":"Invalid indexType '(.+?)' for column '(.+?)'\\. Valid values are: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/VectorIndex.java","lineNumber":119,"sourceCode":"\n        // Only for binary vectors\n        HAMMING,\n        JACCARD,\n        ;\n\n        public static MetricType of(String name) {\n            return valueOf(name.toUpperCase());\n        }\n    }\n\n    private static IndexType parseIndexType(String indexType, String columnName) {\n        if (indexType == null || indexType.trim().isEmpty()) {\n            return null;\n        }\n        try {\n            return IndexType.of(indexType);\n        } catch (IllegalArgumentException exception) {\n            throw new IllegalArgumentException(\n                    String.format(\n                            \"Invalid indexType '%s' for column '%s'. Valid values are: %s\",\n                            indexType, columnName, Arrays.toString(IndexType.values())),\n                    exception);\n        }\n    }\n\n    private static MetricType parseMetricType(String metricType, String columnName) {\n        if (metricType == null || metricType.trim().isEmpty()) {\n            return null;\n        }\n        try {\n            return MetricType.of(metricType);\n        } catch (IllegalArgumentException exception) {\n            throw new IllegalArgumentException(\n                    String.format(\n                            \"Invalid metricType '%s' for column '%s'. Valid values are: %s\",\n                            metricType, columnName, Arrays.toString(MetricType.values())),","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/VectorIndex.java#L101-L137","documentation":"VectorIndex.parseIndexType validates the indexType string via IndexType.of(); if the value is not one of the supported enum values it rethrows an IllegalArgumentException listing the column name and all valid values. Null/blank index types are allowed and return null, so only genuinely invalid strings reach this throw.","triggerScenarios":"Constructing a VectorIndex(name, column, indexType, metricType) with a non-null indexType string that is not in IndexType.values() (wrong case, misspelling, e.g. \"hnsw \" with trailing whitespace or \"HNSW\" vs lowercase-only expected values).","commonSituations":"Vector search config in schema definitions (constraintKeys / vector index options) with a typo'd or wrong-case index type, or configs copied between systems with different index type vocabularies.","solutions":["Set indexType to one of the values listed in the error message (IndexType.values())","Fix case/whitespace issues — trim and match the expected casing exactly","If sourced from config, add validation at parse time using IndexType.of with a friendly fallback"],"exampleFix":"// before\nnew VectorIndex(\"idx\", \"vec\", \"HNSWPROXY\", null); // invalid\n// after\nnew VectorIndex(\"idx\", \"vec\", \"HNSW\", null); // a value from IndexType.values()","handlingStrategy":"validation","validationCode":"boolean valid = Arrays.stream(IndexType.values()).anyMatch(t -> t.name().equalsIgnoreCase(indexType.trim()));\nif (indexType != null && !indexType.trim().isEmpty() && !valid) throw new IllegalArgumentException(\"Bad indexType: \" + indexType);","typeGuard":null,"tryCatchPattern":"try { idx = new VectorIndex(name, col, indexType, metric); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(\"Fix indexType for column \" + col + \": \" + e.getMessage(), e); }","preventionTips":["Copy enum names exactly from IndexType.values() into configs","Trim and normalize case before passing indexType","Validate vector index options at config load time"],"tags":["vector-index","enum","validation"],"backgroundTag":"invalid-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"}