alexanderbianchi commented on code in PR #26603:
URL: https://github.com/apache/datafusion/pull/26603#discussion_r4413272440


##########
datafusion/substrait/src/logical_plan/consumer/rel/join_rel.rs:
##########
@@ -33,12 +36,20 @@ pub async fn from_join_rel(
         return not_impl_err!("JoinRel with post_join_filter is not yet 
supported");
     }
 
-    let left: LogicalPlanBuilder = LogicalPlanBuilder::from(
-        consumer.consume_rel(join.left.as_ref().unwrap()).await?,
-    );
-    let right = LogicalPlanBuilder::from(
-        consumer.consume_rel(join.right.as_ref().unwrap()).await?,
-    );
+    let (Some(left), Some(right)) = (join.left.as_deref(), 
join.right.as_deref()) else {
+        return substrait_err!("JoinRel requires left and right inputs");
+    };
+    let [left, right] = consumer
+        .consume_rel_inputs(&[left, right])

Review Comment:
   We have this lambda code.
   ```
   consumer.push_lambda_parameters(...);     // Enter the function's scope.
   consumer.consume_expression(body, ...).await?;
   consumer.pop_lambda_parameters();         // Leave that scope.
   ```
   It keeps a stack because lambdas can be nested. The consumer carries a 
record of “where am I in this query?” Running two branches concurrently on one 
consumer can mix those records. There's a race condition 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