Summary
validate_index_configs in the MemWAL writer path panics when a configured column resolves in the Arrow schema but is absent from the Lance schema:
|
.expect("column resolved in the Arrow schema is present in the Lance schema") |
let resolved_field_id = lance_schema
.field(column)
.expect("column resolved in the Arrow schema is present in the Lance schema")
.id;
Impact
This is a public, fallible API boundary: writer construction surfaces the panic to callers — and across the Python/Java FFI a Rust panic is far worse than a catchable error. Normal writer construction derives both schemas from the same source, so the trigger requires a diverged Arrow/Lance schema pair, but a fallible public API must return a descriptive error rather than panic on any input.
Proposed fix
Replace the .expect() with Error::invalid_input naming the column and index config, and add a regression test that builds a mismatched Arrow/Lance schema pair and asserts a contextual Err instead of a panic.
Summary
validate_index_configsin the MemWAL writer path panics when a configured column resolves in the Arrow schema but is absent from the Lance schema:lance/rust/lance/src/dataset/mem_wal/index.rs
Line 204 in cea0484
Impact
This is a public, fallible API boundary: writer construction surfaces the panic to callers — and across the Python/Java FFI a Rust panic is far worse than a catchable error. Normal writer construction derives both schemas from the same source, so the trigger requires a diverged Arrow/Lance schema pair, but a fallible public API must return a descriptive error rather than panic on any input.
Proposed fix
Replace the
.expect()withError::invalid_inputnaming the column and index config, and add a regression test that builds a mismatched Arrow/Lance schema pair and asserts a contextualErrinstead of a panic.