Skip to content

bug: validate_index_configs panics on Arrow/Lance schema divergence instead of returning an error #8194

Description

@u70b3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions