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


##########
datafusion/substrait/src/logical_plan/consumer/rel/join_rel.rs:
##########
@@ -15,17 +31,26 @@ use substrait::proto::{JoinRel, join_rel};
 pub async fn from_join_rel(
     consumer: &impl SubstraitConsumer,
     join: &JoinRel,
+    context: &SubstraitConsumerContext,
 ) -> datafusion::common::Result<LogicalPlan> {
     if join.post_join_filter.is_some() {
         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], context)

Review Comment:
   I don't think so, I can add one. But it's especially relevant in case there 
is any IO in the substrait consumer like with an AsyncCatalogProvider (we do 
this internally)



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