Skip to content

fix(file): treat blob fields as opaque single columns in 2.0 projection validation#7620

Closed
jackye1995 wants to merge 1 commit into
lance-format:mainfrom
jackye1995:fix-v2-0-blob-projection-validation
Closed

fix(file): treat blob fields as opaque single columns in 2.0 projection validation#7620
jackye1995 wants to merge 1 commit into
lance-format:mainfrom
jackye1995:fix-v2-0-blob-projection-validation

Conversation

@jackye1995

Copy link
Copy Markdown
Contributor

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:

Invalid user input: projection supplied fewer column indices than its fields require (ran out at field 'position')

Repro: lance.write_dataset(table_with_blob_column, uri, data_storage_version="2.0") then ds.to_table().

The projection build walk silently skips fields with no column mapping, so the builder and validator disagreed exactly where field_column_shape was 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

  • rust: test_validate_length_blob_descriptor (both layouts) — one index satisfies the blob descriptor.
  • python: test_blob_scan_across_file_versions parametrized over 2.0/2.1 — full scan, projected scan, and take_blobs round-trip. The 2.0 case fails without the fix.

…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.
@github-actions github-actions Bot added A-python Python bindings A-encoding Encoding, IO, file reader/writer bug Something isn't working labels Jul 3, 2026
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jackye1995 jackye1995 closed this Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-encoding Encoding, IO, file reader/writer A-python Python bindings bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant