fix(parquet): prevent byte stream split decoder panic - #11136
Open
jaideeppyne wants to merge 1 commit into
Open
jaideeppyne wants to merge 1 commit into
jaideeppyne wants to merge 1 commit into
Conversation
jhorstmann
reviewed
Sep 19, 2026
| fn test_byte_stream_split_uses_encoded_value_count() { | ||
| let mut decoder = ByteStreamSplitDecoder::<DoubleType>::new(); | ||
|
|
||
| decoder.set_data(Bytes::from(vec![0; 64]), 63).unwrap(); |
Contributor
There was a problem hiding this comment.
The decoder seems to silently ignore the num_values parameter here. I would expect it to return an error if data.len() is smaller than num_values * T::get_type_size().
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 #11121.
BYTE_STREAM_SPLIT previously used the page header count as its decode bound while deriving stream stride from the encoded bytes. A malformed header could therefore drive
join_streams_constpast the end of the buffer.This change derives the decoder value count from complete encoded values, rejects partial values and encoded counts larger than the declared page count, and leaves declared counts that include Parquet v1 nulls valid. Higher-level readers now return their existing insufficient-values error for truncated required pages instead of panicking.
Tests cover the reported declared-count mismatch, partial values, and impossible oversized buffers.
Validation:
cargo test -p parquet --libcargo clippy -p parquet --lib --all-features -- -D warningscargo +stable fmt --all -- --checkgit diff --check