Enable setting default values for target_partitions and planning_concurrency#15712
Enable setting default values for target_partitions and planning_concurrency#15712alamb merged 4 commits intoapache:mainfrom
Conversation
|
Sensible changes, but I'm unsure of the implementation. I've had a quick look at the config_namespace! macro and see that there is a |
@ctsk Something like this? pub target_partitions: usize, transform = |x: &str| if x == "0" ...It appears to work well, however Should |
alamb
left a comment
There was a problem hiding this comment.
Makes sense to me -- thank you @nuno-faria and @ctsk for getting the PR to a nicely mergable state
|
CI failure seems unrelated |
|
Merged up from main to try and get a clean CI rnu |
|
Thanks again @nuno-faria -- FYI this will be in the 48 release |
…urrency (apache#15712) * Enable setting default values for target_partitions and planning_concurrency * Fix doc test * Use transform to apply the mapping from 0 to the default parallelism --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Which issue does this PR close?
Rationale for this change
The documentation for the
datafusion.execution.target_partitionsanddatafusion.execution.planning_concurrencysettings states that their default values are set to 0 (which in these cases maps to the number of cores). However, using 0 does not translate to their default values, but rather the literal 0, which is invalid in both cases.In a previous version, setting
datafusion.execution.target_partitionsto 0 resulted in a single partition, while in the current version it results in a division by zero error. Likewise, settingdatafusion.execution.planning_concurrencyto 0 causes the system to hang.With this change, setting
datafusion.execution.target_partitionsordatafusion.execution.planning_concurrencyto 0 will result in the default value being assigned instead, making it coherent with the documentation.What changes are included in this PR?
datafusion/common/config- added the translation to the default values.datafusion/execution/config- updated thewith_target_partitionsmethod.sqllogictest/information_schema- added tests.Are these changes tested?
Yes.
Are there any user-facing changes?
Yes -- when setting these configurations to 0 -- but it will match the existing documentation.