Repository navigation
fix(core): preserve literal field names in schema projection and intersection - #11301
Conversation
Xuanwo
left a comment
There was a problem hiding this comment.
AI-assisted review of 9fe3baae
Please rebase onto main after #11445 and move the ProjectionPlan::from_schema fix to Projection::from_schema in rust/lance-core/src/datatypes/schema.rs. Schema-based Dataset::take and DataFusion now share that entry point. It still passes a field name from a structured schema to base_schema().field(name), which interprets backticks as path syntax. Keep the exact-name matches in project_by_schema and both intersections, and preserve path parsing for user-supplied strings.
On the rebased commit, please rerun the single- and multi-fragment take regressions with repeated, out-of-order indices. Include ordinary a beside a field whose name literally includes both backticks (`a`), a name with an embedded backtick, and a real Int32 field named `_rowaddr` including the backticks. Check the returned values and types so the latter stays distinct from the virtual _rowaddr.
The failures were reproduced on 14.0.3. The candidate was checked from source. Its earlier Rust and Python runs started zero jobs; the unchanged workflows are now authorized to run.
9fe3baa to
59bbcaa
Compare
There was a problem hiding this comment.
✅ Gate recommendation: approve.
After the #11445 rebase, literal-name matching now lives in the shared Projection::from_schema constructor used by dataset takes and DataFusion. Takes preserve values, types, and repeated row order across fragments, including a stored backtick-wrapped _rowaddr column, while user-supplied path parsing remains intact.
[AI-assisted review] 59bbcaae uses the shared Projection::from_schema from #11445. The CI wheel built from the same source tree passes the original take case and preserves reordered and repeated rows across fragments while distinguishing stored and virtual row-address fields. https://github.com/lance-format/lance/actions/runs/46236069611/job/141264558856
Fixes #11305.
Preserve literal field names in schema projection, both intersections, and the shared
Projection::from_schemaentry point after #11445. User-supplied string paths retain their existing parsing behavior.Rust and Python
takeregressions cover single and multiple fragments with repeated, out-of-order indices, checking values and types fora,`a`,a`b, and a real Int32 field named`_rowaddr`.Validation on the rebased source:
takeregressions: 2 passed.taketests passed.cargo fmt --all -- --check,cargo clippy --all --tests --benches -- -D warnings,uv run make lint, and pre-commit checks passed.