feat: add max_row_group_bytes option to ParquetOptions#22649
Open
Satyr09 wants to merge 3 commits into
Open
Conversation
2010YOUY01
reviewed
May 31, 2026
Contributor
2010YOUY01
left a comment
There was a problem hiding this comment.
Thank you! LGTM in general, just some minor advices.
| max_predicate_cache_size: _, | ||
| } = self; | ||
|
|
||
| if let Some(0) = max_row_group_bytes { |
Contributor
There was a problem hiding this comment.
I recommend to move all the config related validation to
- datafusion/common/src/config.rs
You can find examples in config.rs -- there are configurations that are custom type, and a FromStr trait is implemented on them.
|
|
||
| /// (writing) Target maximum size of each row group in bytes. When set, | ||
| /// the writer flushes whenever either this limit or `max_row_group_size` | ||
| /// is reached, whichever comes first. Useful for bounding writer memory |
Contributor
There was a problem hiding this comment.
Let's also update max_row_group_size for this 'whichever comes first` semantics.
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # End-to-end tests for the `max_row_group_bytes` Parquet writer option: |
Contributor
There was a problem hiding this comment.
It would be great to add the following coverages:
- When read back, check the row group count -- for example if
max_row_group_byteswas set to1, there will be 5 row groups created - Test the combination of
max_row_group_sizeandmax_row_group_bytesfor the 'whichever reaches first' semantics.
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
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?
Rationale for this change
arrow-rs 58.0 added WriterProperties::set_max_row_group_bytes (PR: apache/arrow-rs#9357
Issue: apache/arrow-rs#1213), which flushes a row group when either the row-count or the byte limit is reached, whichever comes first, matching parquet-mr's parquet.block.size. DataFusion already consumes atleast this version of arrow but does not yet expose this new byte-based setter through its config.
What changes are included in this PR?
max_row_group_bytes: Option<usize>(default None) to ParquetOptions indatafusion/common/src/config.rs.ParquetOptions::into_writer_properties_buildertoWriterPropertiesBuilder::set_max_row_group_bytes, with a guard that rejects Some(0) as a configuration error (arrow-rs panics on a zero byte limit).Are these changes tested?
Yes - run locally and passing:
Unit (datafusion-common, parquet_writer.rs):
Protobuf round-trip (datafusion-proto-common):
SLTs:
Commands run locally (all pass):
cargo test -p datafusion-common --features parquet
cargo test -p datafusion-proto-common
cargo test -p datafusion-proto
cargo test --test sqllogictests -- parquet_max_row_group_bytes
cargo test --test sqllogictests -- information_schema
cargo test --test sqllogictests -- copy
Are there any user-facing changes?
Additive only, does not affect existing options.