-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Enable setting default values for target_partitions and planning_concurrency #15712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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.