Repository navigation
fix(parquet): reject dictionary pages declaring more values than their bytes hold (#12471) - #12481
Open
Mola-maker wants to merge 1 commit into
Open
Mola-maker wants to merge 1 commit into
Mola-maker wants to merge 1 commit into
Conversation
Contributor
Author
|
@etseidl @birkskyum Could you take a look when you have time? This rejects dictionary pages whose declared |
birkskyum
approved these changes
Nov 27, 2026
birkskyum
left a comment
There was a problem hiding this comment.
Thanks for picking this up. The bound is right for PLAIN dictionaries, and the check runs before every allocation the issue lists (primitive, BYTE_ARRAY, Utf8View and Dictionary readers). The crafted files from the report now fail with the new error at about 7 MB peak, and the parquet-testing files read the same as on main.
This branch has not been deployed
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.
num_valuessizes the dictionary before it is decoded #12471Rationale for this change
The reader sizes allocations from a dictionary page's declared
num_valuesbefore decoding it. A 120-byte file declaringi32::MAXvalues requests about 16 GiB and aborts the process instead of returning an error.What changes are included in this PR?
Before any allocation, the declared count is checked against the decompressed page length at the smallest plain width of the physical type (e.g. 4 bytes per
BYTE_ARRAYvalue for its length prefix). FLBA pages are also still checked exactly againsttype_length, as before.Are these changes tested?
Yes. An end-to-end reader test uses the file from the issue, the three byte-array dictionary decoders each have a unit test, and
check_dictionary_page_valueshas a table test per physical type. Two existing null tests declared 4 values for an empty dictionary; they now declare 0.Are there any significant user-facing changes?
No.
AI usage disclosure
Harness: Muse
Model: Muse Spark
Effort: default
Role: Muse drafted the investigation, fix, and tests under my direction; I reviewed the diff and ran the tests.