ygf11 commented on code in PR #5156:
URL: https://github.com/apache/arrow-datafusion/pull/5156#discussion_r1094210182


##########
datafusion/core/src/physical_plan/joins/nested_loop_join.rs:
##########
@@ -186,37 +171,28 @@ impl ExecutionPlan for NestedLoopJoinExec {
         partition: usize,
         context: Arc<TaskContext>,
     ) -> Result<SendableRecordBatchStream> {
-        // left side
-        let left_fut = if self.is_single_partition_for_left() {
-            // if the distribution of left is `SinglePartition`, just need to 
collect the left one
-            self.left_fut.once(|| {
-                // just one partition for the left side, and the first 
partition is all of data for left
-                load_left_specified_partition(0, self.left.clone(), 
context.clone())
-            })
+        let (outer_table, inner_table) = if left_is_build_side(self.join_type) 
{
+            // left must be single partition
+            let inner_table = self.inner_table.once(|| {
+                load_specified_partition_of_input(0, self.left.clone(), 
context.clone())
+            });
+            let outer_table = self.right.execute(partition, context)?;
+            (outer_table, inner_table)

Review Comment:
   The fix is here, choose the inner_table(`OnceAsync`)  based on the 
build-side(join type).



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to