parquet: return an error instead of panicking when a pushed buffer's length does not match its range - #10564
Merged
alamb merged 1 commit intoAug 6, 2026
Conversation
…length does not match its range
Contributor
|
marking as api change since see: https://docs.rs/parquet/latest/parquet/arrow/push_decoder/struct.PushBuffers.html |
Jefffrey
approved these changes
Aug 6, 2026
alamb
approved these changes
Aug 6, 2026
alamb
left a comment
Contributor
There was a problem hiding this comment.
Thank you @ranflarion and @Jefffrey
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.
Which issue does this PR close?
Closes #10563.
Rationale for this change
A short read pushed into the parquet push decoder panics at
PushBuffers::push_range("Range length must match buffer length") although every public entry point that feeds it returnsResult. Through the async reader this turns a transient store fault into a reader-thread panic the caller cannot classify or retry; the json and avro readers surface the equivalent fault as a decode error.What changes are included in this PR?
PushBuffers::push_rangeandpush_rangesreturnResult<(), ParquetError>instead of asserting (buffer/range length mismatch, and ranges/buffers count mismatch inpush_ranges). The error propagates through the crate-internal chain:ParquetMetaDataPushDecoder::push_range/push_ranges(alreadyResult, now use?), andParquetDecoderState::push_data->RemainingRowGroups::push_data->RowGroupReaderBuilder::push_data, the last two becoming fallible; all their callers were already inResultcontexts.Are these changes tested?
New unit tests in
push_buffers.rscover the accepted case, the short-buffer error, and the count-mismatch error. The existing parquet test suite passes.Are there any user-facing changes?
Changes to
PushBufferspublic API;push_range()andpush_ranges()now return aResult<(), ParquetError>. Code that previously panicked on mismatched pushes now receives anErr.