ewoodbury commented on code in PR #2848:
URL: 
https://github.com/apache/datafusion-ballista/pull/2848#discussion_r4582224219


##########
ballista/scheduler/src/planner.rs:
##########
@@ -202,6 +202,35 @@ impl DefaultDistributedPlanner {
             stages.append(&mut child_stages);
         }
 
+        // A nested-loop join tracks which build rows matched in memory shared 
by
+        // its probe partitions, so a join type that emits build rows is only
+        // correct in one task. Give its probe side a one-partition stage of 
its
+        // own: an inline `CoalescePartitionsExec` would not hold, as
+        // `EnsureRequirements` removes one the join does not require.
+        if let Some(join) = execution_plan.downcast_ref::<NestedLoopJoinExec>()
+            && !collect_left_broadcast_safe(*join.join_type())
+            && children[1]
+                .properties()
+                .output_partitioning()
+                .partition_count()
+                > 1
+        {
+            let probe = 
Arc::new(CoalescePartitionsExec::new(children[1].clone()));

Review Comment:
   Agreed, good idea, but I don't think it's a drop-in change. The static path 
fills in readers with `remove_unresolved_shuffles`, which ignores `coalesce`, 
so a one-group reader would only read upstream partition 0. Rollback drops it 
too and pipelined mode rejects coalesced readers. I'd rather do as a follow-up 
that teaches those paths about coalesced readers, unless you'd prefer it here



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