fix: honor max_row_group_bytes in the parallel Parquet writer - #25041
Open
Satyr09 wants to merge 2 commits into
Open
fix: honor max_row_group_bytes in the parallel Parquet writer#25041Satyr09 wants to merge 2 commits into
Satyr09 wants to merge 2 commits into
Conversation
Synchronize coherent per-column progress and preserve serial row-group boundaries. Cover nested root rows, fractional sizes, failure propagation, cancellation, and encrypted group ordinals. Local Parquet tests and focused Clippy pass; full validation is moving to Linux CI as requested.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25041 +/- ##
==========================================
+ Coverage 81.64% 81.72% +0.08%
==========================================
Files 1125 1127 +2
Lines 413843 416419 +2576
Branches 413843 416419 +2576
==========================================
+ Hits 337868 340312 +2444
- Misses 56056 56111 +55
- Partials 19919 19996 +77 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Satyr09
marked this pull request as ready for review
September 7, 2026 23:09
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 #22982.
Rationale for this change
max_row_group_bytes, added in #22649, is currently ignored when parallel writing is enabled (the default). This PR lets users apply the byte target without switching to the single-threaded writer.What changes are included in this PR?
Column workers report their estimated encoded sizes. When a byte target is set, the writer waits for all columns to finish each input slice before deciding how many rows to write next. This follows the single-threaded writer's splitting policy and produces the same row-group boundaries for the same batches and settings.
Columns still encode in parallel, but waiting between slices can reduce throughput. This synchronization is only used when the byte target is set. The docs explain the tradeoff.
What is the testing strategy for this PR?
Added SQL and writer tests for row/byte limits, readback, matching serial boundaries, nested data, compression, empty batches, errors, cancellation, and encryption.
I also ran DataFusion's existing SQL
benchmark_runnerwith COPY workloads on a four-CPU Linux runner. Each case wrote 131,072 rows; the table shows median times in ms from two rounds, excluding warmups. Results and workloads/setup are available on my fork.All three modes had the byte target set, but the original parallel writer ignores it. This PR matched the serial writer's row-group layouts in all four cases, and all retained outputs passed readback checks. Timings varied between rounds, so these are preliminary results.
With the option unset, three of the four controls were within 0.5% of the original median; the wide-string control was noisy.
One issue still to investigate: peak tracked memory for rotating strings rose from 14.43 MiB to 40.22 MiB in both rounds. The original writer produced one group and this version produced six, but the cause of the increase has not been isolated. These figures are DataFusion memory reservations, not process RSS.
Are there any user-facing changes?
Yes. The byte target now works with parallel writing. It remains an estimate that can overshoot, not a hard byte or memory limit. The default stays
None, with only the row-count limit applied.