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


##########
datafusion/physical-optimizer/src/enforce_distribution.rs:
##########
@@ -1454,21 +1480,58 @@ pub fn ensure_distribution(
         plan.with_new_children(children_plans)?
     };
 
+    // For partitioned hash joins, decide dynamic filter routing mode.
+    //
+    // PartitionIndex routing requires that partition `i` on the build side 
corresponds to
+    // partition `i` on the probe side. This holds when both sides' 
partitioning comes from
+    // file-grouped sources (via `preserve_file_partitions`) rather than hash 
repartitioning.
+    plan = if let Some(hash_join) = 
plan.as_any().downcast_ref::<HashJoinExec>()
+        && matches!(hash_join.mode, PartitionMode::Partitioned)
+    {
+        let routing_mode =

Review Comment:
   good catch



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