{"record":{"id":"ae162fa6645babb6","repo":"risingwavelabs/risingwave","slug":"expect-vector-column-but-got","errorCode":null,"errorMessage":"expect vector column but got: {:?}","messagePattern":"expect vector column but got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/from_proto/vector_index_write.rs","lineNumber":51,"sourceCode":"        params: ExecutorParams,\n        node: &Self::Node,\n        store: impl StateStore,\n    ) -> StreamResult<Executor> {\n        let [input]: [_; 1] = params.input.try_into().unwrap();\n\n        let table = node.table.as_ref().unwrap();\n        assert_eq!(table.columns.len(), input.schema().len());\n        let index_col_type = DataType::from(\n            table.columns[0]\n                .column_desc\n                .as_ref()\n                .unwrap()\n                .column_type\n                .as_ref()\n                .unwrap(),\n        );\n        let DataType::Vector(dimension) = &index_col_type else {\n            bail!(\"expect vector column but got: {:?}\", index_col_type)\n        };\n        let DataType::Vector(input_dimension) = &input.schema().fields[0].data_type else {\n            bail!(\n                \"expect first input vector column but got: {:?}\",\n                index_col_type\n            )\n        };\n        assert_eq!(dimension, input_dimension);\n\n        let executor = VectorIndexWriteExecutor::new(input, store, table.id).await?;\n        Ok(Executor::new(params.info, Box::new(executor)))\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":65,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/from_proto/vector_index_write.rs#L33-L65","documentation":"The vector index write executor validates that the index column's data type is `DataType::Vector(dimension)`. If the retrieved index column type is not a vector type, it bails with 'expect vector column but got: {type}', meaning the index write's schema doesn't match a vector index.","triggerScenarios":"Building a vector-index write executor (stream plan for writing into a vector index) where the index column type resolved from the proto is not `DataType::Vector` — e.g. a non-vector column wired as the index column or a corrupted/mismatched plan.","commonSituations":"Running an `CREATE INDEX ... USING hnsw`-style flow where the indexed column isn't of vector type; internal plan/proto inconsistencies after schema changes.","solutions":["Ensure the column used in the vector index is declared as `VECTOR(dim)`.","Recreate the index on a column with the correct vector type.","Re-run the DDL; if it persists, check for plan/proto mismatches and report a bug.","Verify upstream MV/schema wasn't altered incompatibly."],"exampleFix":"// before\nCREATE INDEX ON t (embedding_text);\n// after\nCREATE INDEX ON t USING hnsw (embedding vector_cosine_ops);","handlingStrategy":"type-guard","validationCode":"-- the indexed column must be VECTOR type\nSELECT data_type FROM information_schema.columns WHERE table_name='t' AND column_name='embedding';","typeGuard":"fn is_vector(t: &DataType) -> bool { matches!(t, DataType::Vector(_)) }","tryCatchPattern":null,"preventionTips":["Only create vector indexes on VECTOR-typed columns.","Avoid altering the indexed column type after index creation.","Verify column types with information_schema before DDL."],"tags":["vector-index","schema","type-mismatch"],"backgroundTag":"type-mismatch","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}