fix(file): treat blob fields as opaque single columns in 2.0 projection validation#7620
Closed
jackye1995 wants to merge 1 commit into
Closed
fix(file): treat blob fields as opaque single columns in 2.0 projection validation#7620jackye1995 wants to merge 1 commit into
jackye1995 wants to merge 1 commit into
Conversation
…on validation The projection length validation added for unequal-length columns walked into a blob field's descriptor struct on 2.0-layout files, demanding column indices for position/size. A blob is one opaque physical column in every file version, so any blob-bearing 2.0 dataset failed to scan with "projection supplied fewer column indices than its fields require (ran out at field 'position')". Short-circuit blob and packed-struct fields in field_column_shape (shared by the projection build and validation walks) before the layout branch.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The projection length validation introduced in #7406 walks into a blob field's
struct<position,size>descriptor on 2.0-layout files and demands column indices for the children. A blob is one opaque physical column in every file version, so any blob-bearing 2.0 dataset fails to scan on 9.0.0b14:Repro:
lance.write_dataset(table_with_blob_column, uri, data_storage_version="2.0")thends.to_table().The projection build walk silently skips fields with no column mapping, so the builder and validator disagreed exactly where
field_column_shapewas supposed to keep them in lockstep.Fix
Short-circuit blob and packed-struct fields in
field_column_shape(shared by both walks) before the layout branch: they contribute one column and are never descended into, regardless of file version. 2.1 behavior is unchanged (it already treated them as opaque).Tests
test_validate_length_blob_descriptor(both layouts) — one index satisfies the blob descriptor.test_blob_scan_across_file_versionsparametrized over 2.0/2.1 — full scan, projected scan, andtake_blobsround-trip. The 2.0 case fails without the fix.