fix(compaction): reject unsafe binary column layouts - #8510
Conversation
# Conflicts: # rust/lance/src/dataset/optimize.rs # rust/lance/src/dataset/optimize/tests/binary_copy.rs
|
Blocked: PR #8510 at remote head The current |
# Conflicts: # rust/lance/src/dataset/optimize/tests/binary_copy.rs
|
Blocked: PR #8510 at remote head The current |
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The latest base only optimizes manifest column-index validation; this PR still applies the version-specific canonical-mapping guard before the restored binary-copy implementation. Noncanonical inputs safely re-encode under TryBinaryCopy, while canonical nested and packed layouts remain eligible across V2.0–V2.3. With PR #8660 reverted by PR #8926, retaining this conservative boundary here remains correct.
Summary
TryBinaryCopysafely fall back to re-encoding when files use another physical column orderRoot cause
Binary-copy eligibility only required source files to agree with one another. The copy loop preserved their physical page order, but output metadata was regenerated in dataset-schema order, so uniformly reordered source files crossed logical columns after compaction.
Related work
PR #8479 proposes the same eligibility invariant for the separate metadata-only schema-evolution scenario in #8281. This repair is tied to the direct public-API reordered-column reproduction in #8501 and adds regression coverage for that distinct trigger.
Validation
cargo test -p lance dataset::optimize::tests::binary_copy(19 passed)cargo fmt --all -- --checkcargo clippy --all --tests --benches -- -D warningsFixes #8501