gstvg commented on code in PR #21193:
URL: https://github.com/apache/datafusion/pull/21193#discussion_r3208931425
##########
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:
@benbellick I usually follows the pattern of existing methods, like
`push/pop_outer_schema` from https://github.com/apache/datafusion/pull/20439.
This is my first time dealing with substrait, so I may be wrong, but I didn't
followed this pattern (using `push/pop_lambda_parameter`) because it modifies
&self via a RwLock and I'm note sure this couldn't lead to conflicts if the
same consumer is used to consume two different plans at the same time in
different threads. If that's not the case I can change this to use
`push/pop_lambda_parameter` as well.
--
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]