gene-bordegaray commented on code in PR #20331:
URL: https://github.com/apache/datafusion/pull/20331#discussion_r2819399629


##########
datafusion/physical-plan/src/joins/hash_join/exec.rs:
##########
@@ -809,6 +831,23 @@ impl HashJoinExec {
         self.dynamic_filter.as_ref().map(|df| &df.filter)
     }
 
+    /// Determines whether partition-index routing should be used instead of 
CASE hash routing.
+    ///
+    /// Enabled when:
+    /// 1. The join is in `Partitioned` mode
+    /// 2. The optimizer selected `DynamicFilterRoutingMode::PartitionIndex`.
+    ///
+    /// Note: In CollectLeft mode, even when the probe side (right) has 
misaligned partitonings,
+    /// this works correctly because there is a single shared hash table built 
from the coalesced
+    /// left side. All probe partitions use the same hash table for lookups. 
This applies to
+    /// dynamic filters as well, the single build-side filter is sufficient 
for all probe
+    /// partitions.
+    fn should_use_partition_index(&self) -> bool {
+        matches!(self.mode, PartitionMode::Partitioned)
+            && self.dynamic_filter_routing_mode
+                == DynamicFilterRoutingMode::PartitionIndex

Review Comment:
   Yes, if thre is a partitione dhash join and both sides contain a repartition 
-> it would use `CaseHash`



-- 
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]

Reply via email to