{"record":{"id":"7b876cba2c492f00","repo":"risingwavelabs/risingwave","slug":"expect-first-input-vector-column-but-got","errorCode":null,"errorMessage":"expect first input vector column but got: {:?}","messagePattern":"expect first input vector column but got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/from_proto/vector_index_write.rs","lineNumber":54,"sourceCode":"    ) -> 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":36,"sourceCodeEnd":65,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/from_proto/vector_index_write.rs#L36-L65","documentation":"The vector index write executor also validates that the first field of the upstream input schema is a `DataType::Vector`. If not, it bails with 'expect first input vector column but got: {type}'. Additionally the dimension equality with the index column is asserted right after.","triggerScenarios":"Building the vector index write executor where the first input column of the upstream executor is not a vector type — e.g. the planner wired a non-vector column first, or the input MV schema changed so the vector column is no longer field 0.","commonSituations":"See trigger scenarios.","solutions":["Ensure the upstream stream produces the vector column as its first field with `VECTOR(dim)` type.","Recreate the vector index and downstream flow after any base-table schema changes.","Check that the indexed column and input column dimensions match (a separate assert fires otherwise).","If reproducible with consistent DDL, report as a frontend/planner bug."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"-- ensure the upstream MV's first column is the vector column of matching dimension\nDESCRIBE mv_name;","typeGuard":"fn first_field_is_vector(schema: &Schema) -> bool { matches!(schema.fields[0].data_type, DataType::Vector(_)) }","tryCatchPattern":null,"preventionTips":["Keep the vector column as the first output column of the upstream MV feeding the index.","Recheck dimensions after any base-table schema change.","Recreate the index when upstream schema drifts."],"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"}