{"record":{"id":"c91dee0e7e0343d4","repo":"apache/seatunnel","slug":"schema-constraintkeys-s-constraintcolumns-s-co","errorCode":null,"errorMessage":"schema.constraintKeys[%s].constraintColumns[%s] config invalid: %s","messagePattern":"schema\\.constraintKeys\\[(.+?)\\]\\.constraintColumns\\[(.+?)\\] config invalid: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/schema/ReadonlyConfigParser.java","lineNumber":244,"sourceCode":"                                                            \"schema.constraintKeys[%s].constraintColumns.* config need option [columnName], please correct your config first\",\n                                                            constraintName)));\n            if (constraintType == ConstraintKey.ConstraintType.VECTOR_INDEX_KEY) {\n                String indexName =\n                        constraintColumnConfig\n                                .getOptional(ConnectorCommonOptions.VECTOR_INDEX_NAME)\n                                .orElse(null);\n                String indexType =\n                        constraintColumnConfig\n                                .getOptional(ConnectorCommonOptions.VECTOR_INDEX_TYPE)\n                                .orElse(null);\n                String metricType =\n                        constraintColumnConfig\n                                .getOptional(ConnectorCommonOptions.VECTOR_METRIC_TYPE)\n                                .orElse(null);\n                try {\n                    return new VectorIndex(indexName, columnName, indexType, metricType);\n                } catch (IllegalArgumentException exception) {\n                    throw new IllegalArgumentException(\n                            String.format(\n                                    \"schema.constraintKeys[%s].constraintColumns[%s] config invalid: %s\",\n                                    constraintName, columnName, exception.getMessage()),\n                            exception);\n                }\n            }\n            ConstraintKey.ColumnSortType columnSortType =\n                    constraintColumnConfig.get(\n                            ConnectorCommonOptions.CONSTRAINT_KEY_COLUMN_SORT_TYPE);\n            return ConstraintKey.ConstraintKeyColumn.of(columnName, columnSortType);\n        }\n    }\n\n    private static class PrimaryKeyParser\n            implements TableSchemaParser.PrimaryKeyParser<ReadonlyConfig> {\n\n        @Override\n        public PrimaryKey parse(ReadonlyConfig schemaConfig) {","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/table/catalog/schema/ReadonlyConfigParser.java#L226-L262","documentation":"When parsing schema.constraintKeys, each constraint column's vector index options are validated by constructing a VectorIndex. If VectorIndex's constructor rejects the indexType or metricType, this wraps that error in a contextual IllegalArgumentException naming the constraint key, column, and the underlying message — so the invalid config can be located.","triggerScenarios":"A config's schema.constraintKeys entry has a column whose vector index_type or metric_type option is not a valid IndexType/MetricType enum value; VectorIndex throws and parseConstraintColumn rewraps it.","commonSituations":"Typos or wrong casing in indexType/metricType within constraintKeys blocks, configs copied from other vector databases, or version drift where a metric type isn't supported.","solutions":["Fix the indexType/metricType values for that column to valid enum values (see inner message and VectorIndex docs)","Trim/correct casing of the configured values","Remove the constraintKeys entry if vector indexing is not intended for that column"],"exampleFix":"// before\nconstraintKeys = [{ name = idx, constraintColumns = [{ columnName = vec, indexType = IVF_PROXY }] }]\n// after\nconstraintKeys = [{ name = idx, constraintColumns = [{ columnName = vec, indexType = HNSW }] }]","handlingStrategy":"validation","validationCode":"// before parsing config, validate each constraint column's options\nArrays.stream(MetricType.values()).anyMatch(t -> t.name().equalsIgnoreCase(metric));\nArrays.stream(IndexType.values()).anyMatch(t -> t.name().equalsIgnoreCase(indexType));","typeGuard":null,"tryCatchPattern":"try { parse(config); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(\"Invalid constraintKeys config: \" + e.getMessage(), e); }","preventionTips":["Keep constraintKeys vector options limited to valid IndexType/MetricType values","Test schema parsing of configs in CI before deploying jobs","Avoid copy-pasting index/metric names from other vector database docs"],"tags":["config","vector-index","constraint"],"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-23T08:17:48.524Z"}