Repository navigation
fix: read full-zip pages that pad each value with a zero control word - #10669
Merged
Merged
Conversation
Contributor
Author
|
The padding is now a private flag on |
…-word # Conflicts: # rust/lance-encoding/src/encodings/logical/primitive/fullzip_decode.rs
Contributor
There was a problem hiding this comment.
The author has accepted the known ambiguity. Some historical variable-width pages can still silently return incorrect values; compare suspect data with its source before treating a rewritten copy as repaired.
The recovery and NIL list-length handling remain acceptable. Padding remains private decoder state, so the earlier breaking-change request remains withdrawn.
Xuanwo
approved these changes
Nov 20, 2026
Contributor
Author
|
Thank you @Xuanwo |
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.
Closes #10668.
Writers before 13.0.0 could store a
0x00control-word byte before each value of a full-zip page whose layout records no control-word bits. The reader takes that layout as NIL, so variable-width columns fail to read and fixed-width columns read shifted values. The decoder now marks such pages as padded and skips that byte:rows * (bytes_per_value + 1)bytes.Value reads reject a non-zero padding byte. A padded variable-width page whose NIL walk happens to succeed is still read as NIL, as before. For example, a read range holding one value of length L (L < 2^24) followed by exactly 255·L − 1 empty values returns the first value as 256·L bytes.
array_lengthon NIL pagesThe list structure path from #10759 built an empty def buffer for a full-zip
FixedSizeListpage with nullable layers and a NIL control word, soarray_lengthfailed withIncorrect length of values buffer for FixedSizeListArray. The current writer emits such a page whenever a page of such a column has no nulls, and the padded pages have the same shape. That path now reads a NIL page as all valid, as the value path does.Tests
test_v4_0_1_merge_insert_padded_control_wordsscans a binary column that pylance 4.0.1 wrote through amerge_insertupdating only some columns (Data corruption with sub-schemamerge_insertondata_storage_version=2.2#6338).test_v11_0_0_fullzip_padded_control_wordsreads pylance 11.0.0FixedSizeList<Struct>columns with alarge_binaryor aFixedSizeList<float32, 128>child through scan, 3-row batches and take. The generators assert the defect is still written. Without the recovery, both tests fail with a corrupt-file error.test_v11_0_0_fullzip_padded_control_words_list_lengthrunsarray_lengthon the 11.0.0 columns.test_list_structure_fixed_outergains two full-zip cases from the current writer whose second file has no nulls. They fail without the list structure change.variable_full_zip_reads_nil_page,variable_full_zip_rejects_nonzero_padding,fixed_full_zip_reads_padded_nil_page,test_has_padded_fixed_control_words: pages read whole or in parts, non-zero padding, and the fixed-width size check.I also checked by hand that this branch reads padded files written by pylance 2.0.0, 4.0.1, 6.0.1, 11.0.0 and 12.0.0, which 14.0.2 can't read or reads wrong.
🤖 Generated with Claude Code