risingwavelabs/risingwave · error

expect first input vector column but got

Error message

expect first input vector column but got: {:?}

What it means

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.

Solutions

  1. Ensure the upstream stream produces the vector column as its first field with `VECTOR(dim)` type.
  2. Recreate the vector index and downstream flow after any base-table schema changes.
  3. Check that the indexed column and input column dimensions match (a separate assert fires otherwise).
  4. If reproducible with consistent DDL, report as a frontend/planner bug.
Defensive patterns

Strategy: type-guard

Validate before calling

-- ensure the upstream MV's first column is the vector column of matching dimension
DESCRIBE mv_name;

Type guard

fn first_field_is_vector(schema: &Schema) -> bool { matches!(schema.fields[0].data_type, DataType::Vector(_)) }

Prevention

When it happens

Trigger: 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.

Common situations: See trigger scenarios.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/7b876cba2c492f00. Report an issue: GitHub.

Appendix: source

Thrown at src/stream/src/from_proto/vector_index_write.rs:54

    ) -> StreamResult<Executor> {
        let [input]: [_; 1] = params.input.try_into().unwrap();

        let table = node.table.as_ref().unwrap();
        assert_eq!(table.columns.len(), input.schema().len());
        let index_col_type = DataType::from(
            table.columns[0]
                .column_desc
                .as_ref()
                .unwrap()
                .column_type
                .as_ref()
                .unwrap(),
        );
        let DataType::Vector(dimension) = &index_col_type else {
            bail!("expect vector column but got: {:?}", index_col_type)
        };
        let DataType::Vector(input_dimension) = &input.schema().fields[0].data_type else {
            bail!(
                "expect first input vector column but got: {:?}",
                index_col_type
            )
        };
        assert_eq!(dimension, input_dimension);

        let executor = VectorIndexWriteExecutor::new(input, store, table.id).await?;
        Ok(Executor::new(params.info, Box::new(executor)))
    }
}

View on GitHub (pinned to 6469eb736d)