Satyr09 opened a new pull request, #22649:
URL: https://github.com/apache/datafusion/pull/22649

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   - Closes #.
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in 
the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your 
changes and offer better suggestions for fixes.  
   -->
   
   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?
   
   <!--
   There is no need to duplicate the description in the issue here but it is 
sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   - Add `max_row_group_bytes: Option<usize>` (default None) to ParquetOptions 
in `datafusion/common/src/config.rs`.
   - Wire it through `ParquetOptions::into_writer_properties_builder` to 
`WriterPropertiesBuilder::set_max_row_group_bytes`, with a guard that rejects 
Some(0) as a configuration error (arrow-rs panics on a zero byte limit).
   - Update the generated config docs (configs.md, regenerated via 
dev/update_config_docs.sh) and the format options table (format_options.md).
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are 
they covered by existing tests)?
   -->
   
   Yes. New unit tests in datafusion/common/src/file_options/parquet_writer.rs 
cover:
   - the option defaults to None (no byte limit propagated to WriterProperties),
   - a configured value propagates to WriterProperties,
   - Some(0) is rejected with a configuration error.
   
   
   The existing round-trip test (`table_parquet_opts_to_writer_props`) and the 
defaults test (`test_defaults_match`) were extended to include the new field, 
so serialization round-trips and default consistency are
   exercised. Verified locally with:
   
   `cargo test -p datafusion-common --features parquet`
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   Additive only, does not affect existing options.
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to