Skip to content

fix(encoding): accept 1-bit booleans in the single-row full-zip fallback - #8934

Merged
zhangyue19921010 merged 1 commit into
lance-format:mainfrom
zhangyue19921010:fix/fullzip-fallback-precheck
Sep 2, 2026
Merged

fix(encoding): accept 1-bit booleans in the single-row full-zip fallback#8934
zhangyue19921010 merged 1 commit into
lance-format:mainfrom
zhangyue19921010:fix/fullzip-fallback-precheck

Conversation

@zhangyue19921010

Copy link
Copy Markdown
Collaborator

When a single top-level row carries more rep/def levels than one mini-block chunk can hold, the primitive encoder falls back to full-zip after a pre-check that the value block is something full-zip can serialize. That pre-check rejected 1-bit booleans as non-byte-aligned, although encode_full_zip widens them to bytes before compressing (#6723).

A sparse List<List<Boolean>> row therefore failed with "Mini-block cannot encode N rep/def levels in one top-level row" even though it encodes fine, and even when the user explicitly requested structural_encoding=fullzip. Before #6787 the same row was written through full-zip.

The pre-check now lets 1-bit fixed-width blocks through, matching what encode_full_zip accepts. The boolean test that asserted the error now asserts a full-zip round trip alongside the existing string case.

When a single top-level row carries more rep/def levels than one mini-block
chunk can hold, the primitive encoder falls back to full-zip after a
pre-check that the value block is something full-zip can serialize. That
pre-check rejected 1-bit booleans as non-byte-aligned, although
`encode_full_zip` widens them to bytes before compressing (lance-format#6723).

A sparse `List<List<Boolean>>` row therefore failed with "Mini-block cannot
encode N rep/def levels in one top-level row" even though it encodes fine,
and even when the user explicitly requested `structural_encoding=fullzip`.
Before lance-format#6787 the same row was written through full-zip.

The pre-check now lets 1-bit fixed-width blocks through, matching what
`encode_full_zip` accepts. The boolean test that asserted the error now
asserts a full-zip round trip alongside the existing string case.
@github-actions github-actions Bot added A-encoding Encoding, IO, file reader/writer bug Something isn't working labels Sep 2, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate recommendation: approve.

The capability check now matches the existing full-zip boolean encoder/decoder contract: 1-bit booleans are widened, while other unsupported non-byte-aligned widths remain rejected. The regression covers full-zip selection and round-trip decoding for the unsplittable single-row shape.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 2, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@zhangyue19921010

Copy link
Copy Markdown
Collaborator Author

Nice

@Xuanwo Thanks for your review :)

@zhangyue19921010
zhangyue19921010 merged commit b01498c into lance-format:main Sep 2, 2026
37 checks passed
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 bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants