ShayanGho commented on code in PR #25787:
URL: https://github.com/apache/datafusion/pull/25787#discussion_r4716776246
##########
datafusion/physical-optimizer/src/ensure_requirements/enforce_distribution.rs:
##########
@@ -1362,6 +1364,26 @@ fn enforce_distribution_relationships(
}
};
+ // Do not adapt a child above the `CollectLeft` thresholds to a
reference
+ // below them; fall back to hash partitioning instead. Otherwise keep
the
+ // reference, so that it is not shuffled as well.
+ let best_satisfied_child = best_satisfied_child.filter(|(ref_idx, _)| {
+ let is_small = |idx: usize| {
+ let stats = stats_ctx
+ .compute_arc(&children[idx].context.plan,
&StatisticsArgs::new())
+ .ok()?;
+ below_collect_thresholds(
+ &stats,
+ config.optimizer.hash_join_single_partition_threshold,
+ config.optimizer.hash_join_single_partition_threshold_rows,
+ )
+ };
+ is_small(*ref_idx) != Some(true)
Review Comment:
@jayzhan211 done:
- Limited the gate to range references and added
`hash_join_reference_kept_below_thresholds`. It fails without the condition.
- Merged main and regenerated `configs.md`.
- Fixed the `Auto` sentence and rewrote the Rationale as suggested.
--
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]