benbellick commented on code in PR #21193:
URL: https://github.com/apache/datafusion/pull/21193#discussion_r3209291427


##########
datafusion/substrait/src/logical_plan/consumer/substrait_consumer.rs:
##########
@@ -481,6 +526,27 @@ pub trait SubstraitConsumer: Send + Sync + Sized {
         };
         substrait_err!("Missing handler for user-defined literals {}", 
type_ref)
     }
+
+    // Lambda related methods
+
+    /// Returns a new instance of this consumer which includes the given 
`lambda_parameters` and the names they got assigned
+    ///
+    /// Note for custom implementations it's possible to embed a 
[DefaultSubstraitLambdaConsumer] and forward this method to it
+    fn with_lambda_parameters(
+        &self,
+        lambda_parameters: &[Type],
+        input_schema: &DFSchema,
+    ) -> datafusion::common::Result<(Vec<String>, Self)>;

Review Comment:
   Ah, that is an interesting point... Is it expected/supported for the same 
`SubstraitConsumer` instance to be used concurrently?
   
   If not, then I think it would be simpler and consistent to model lambda 
scope the same way as outer schemas.
   
   If yes, then the scoped-consumer approach here makes sense, but it seems 
like the existing `push_outer_schema` / `pop_outer_schema` stack may have the 
same interleaving issue and should probably be addressed separately.
   



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