Repository navigation
fix(parquet): return byte array overflow and map decoding errors - #11791
Conversation
Check cumulative delta-length byte-array offsets before reserving or copying payloads, and propagate Map child-reader errors instead of panicking. Use checked arithmetic when validating page lengths. Add offset-boundary, decoder-state, and malformed-map regressions. The large-buffer regression is opt-in and also checks that an overflow leaves the output and decoder cursors unchanged. Relates to apache#7973 and apache#11478. Implemented with assistance from OpenAI Codex.
b54a490 to
44101cc
Compare
| } | ||
|
|
||
| #[test] | ||
| #[ignore = "allocates about 2 GiB; run --ignored --test-threads=1"] |
There was a problem hiding this comment.
not sure its worth keeping this test in that case 🤔
There was a problem hiding this comment.
I’d like to keep it as a manual regression for the real decoder’s overflow handling and state preservation, which the small arithmetic tests don’t cover, while avoiding a ~2 GiB allocation in routine CI; I’ve added a comment explaining this.
There was a problem hiding this comment.
in what cases would we ever remember to run this, given our overall test suite is already quite large
There was a problem hiding this comment.
My intended use case is to run this myself while developing and validating the follow-up fixes in this series, rather than expect maintainers to remember to run it. Once capacity-safe decoding and batch splitting are in place, I plan to replace this interim panic-to-error check with end-to-end tests that verify successful reads of more than 2 GiB of logical payload across valid output batches. Ideally, that coverage would run automatically in a suitable CI job.
Which issue does this PR close?
First part(1/4) of the solution. Whole solution can be found here: #11478 (comment)
This addresses panic handling only. Reading oversized
Utf8/Binarybatches successfully and bounding Mask decoding memory are separate changes.Rationale for this change
Reading
DELTA_LENGTH_BYTE_ARRAYdata can panic when the cumulative payload exceeds the output offset range. Map decoding can also panic when an underlying reader returns an error.These failures should return explicit errors through the normal reader error path.
What changes are included in this PR?
Are these changes tested?
Yes. Added regression tests cover:
Both panic regressions fail against the original implementation and pass with these changes. Workspace tests and the additional Parquet async/experimental tests also pass.
Are there any significant user-facing changes?
No additional changes beyond the error handling described above. There are no public API changes.
AI assistance: OpenAI Codex assisted with implementation and regression tests.