Aaryan-Dadu opened a new pull request, #26716: URL: https://github.com/apache/datafusion/pull/26716
## Which issue does this PR close? - Part of #26299 ## Rationale for this change Step 1 from the issue. The per-child closure in `ensure_distribution_with_stats` works out several flags inline (`allow_subset_satisfy_partitioning`, `add_roundrobin`, `needs_repartition`, ...). They depend on each other and can only be tested through full plan tests right now. This moves them into one place so they can be unit tested. No behaviour change. ## What changes are included in this PR? - `ChildPolicyConfig`: the settings that are the same for every child. - `ChildPolicy::new`: works out the flags for one child. The partial aggregate check (including the `partial_aggregate_input_keeps_groups_local` case from #26449) is passed as a closure, so it still only runs when it did before. - `ChildPolicy::needs_hash_repartition`: the repartition decision from the hash arm. - The closure now uses these. The rest of the function is unchanged. ## What is the testing strategy for this PR? New unit tests in `enforce_distribution.rs` for the flags. The existing `physical_optimizer` tests and sqllogictests pass without changes. <!-- screenshot: cargo test -p datafusion-physical-optimizer --lib -- enforce_distribution --> ## Are there any user-facing changes? No -- 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]
