You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/07/15 21:53:36 UTC
(datafusion) branch gh-readonly-queue/main/pr-23597-a8f54807875b9da3b64b850de0b6bc58e3fa8d6b created (now 501f14c628)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-23597-a8f54807875b9da3b64b850de0b6bc58e3fa8d6b
in repository https://gitbox.apache.org/repos/asf/datafusion.git
at 501f14c628 minor: validate config `soft_max_rows_per_output_file` when setting it (#23597)
This branch includes the following new commits:
new 501f14c628 minor: validate config `soft_max_rows_per_output_file` when setting it (#23597)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org
(datafusion) 01/01: minor: validate config `soft_max_rows_per_output_file` when setting it (#23597)
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-23597-a8f54807875b9da3b64b850de0b6bc58e3fa8d6b
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit 501f14c6286eb9eddd56e97f610b65a73c98231c
Author: Yongting You <20...@gmail.com>
AuthorDate: Thu Jul 16 05:53:15 2026 +0800
minor: validate config `soft_max_rows_per_output_file` when setting it (#23597)
## 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.
-->
- Part of https://github.com/apache/datafusion/issues/17498
## 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.
-->
This is logically the same change as #23592, but for another
configuration.
0 is a invalid setting here, and such value might cause very large
output file count.
## 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.
-->
## 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)?
-->
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
Co-authored-by: Andrew Lamb <an...@nerdnetworks.org>
---
datafusion/common/src/config.rs | 2 +-
datafusion/datasource/src/write/demux.rs | 2 +-
datafusion/sqllogictest/test_files/set_variable.slt | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/datafusion/common/src/config.rs b/datafusion/common/src/config.rs
index fb0345eba2..6d23d26418 100644
--- a/datafusion/common/src/config.rs
+++ b/datafusion/common/src/config.rs
@@ -873,7 +873,7 @@ config_namespace! {
/// This is a soft max, so it can be exceeded slightly. There also
/// will be one file smaller than the limit if the total
/// number of rows written is not roughly divisible by the soft max
- pub soft_max_rows_per_output_file: usize, default = 50000000
+ pub soft_max_rows_per_output_file: ConfigNonZeroUsize, default = non_zero_usize_default(50000000)
/// This is the maximum number of RecordBatches buffered
/// for each output file being worked. Higher values can potentially
diff --git a/datafusion/datasource/src/write/demux.rs b/datafusion/datasource/src/write/demux.rs
index acc6435acf..f73c03d81d 100644
--- a/datafusion/datasource/src/write/demux.rs
+++ b/datafusion/datasource/src/write/demux.rs
@@ -153,7 +153,7 @@ async fn row_count_demuxer(
) -> Result<()> {
let exec_options = &context.session_config().options().execution;
- let max_rows_per_file = exec_options.soft_max_rows_per_output_file;
+ let max_rows_per_file = exec_options.soft_max_rows_per_output_file.get();
let max_buffered_batches = exec_options.max_buffered_batches_per_output_file;
let minimum_parallel_files = exec_options.minimum_parallel_output_files;
let mut part_idx = 0;
diff --git a/datafusion/sqllogictest/test_files/set_variable.slt b/datafusion/sqllogictest/test_files/set_variable.slt
index 009c5e0d93..4101c1dc70 100644
--- a/datafusion/sqllogictest/test_files/set_variable.slt
+++ b/datafusion/sqllogictest/test_files/set_variable.slt
@@ -724,6 +724,9 @@ SET datafusion.runtime.list_files_cache_ttl = '1m18446744073709551556s'
statement error DataFusion error: Invalid or Unsupported Configuration: value must be greater than 0
SET datafusion.execution.batch_size = 0
+statement error DataFusion error: Invalid or Unsupported Configuration: value must be greater than 0
+SET datafusion.execution.soft_max_rows_per_output_file = 0
+
statement error DataFusion error: Invalid or Unsupported Configuration: value must be greater than 0
SET datafusion.execution.max_spill_file_size_bytes = 0
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org