yyy1000 commented on code in PR #8985:
URL: https://github.com/apache/arrow-datafusion/pull/8985#discussion_r1483898980
##########
datafusion/expr/src/udf.rs:
##########
@@ -249,6 +261,22 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
/// the arguments
fn return_type(&self, arg_types: &[DataType]) -> Result<DataType>;
+ /// What [`DataType`] will be returned by this function, given the types of
+ /// the expr arguments
+ fn return_type_from_exprs(
Review Comment:
This works well on my side. Thanks!
Another question for me is, how can user implement `return_type_from_exprs`
when using `schema`. For example,
`arg_exprs.get(take_idx).unwrap().get_type(schema)` will lead an error
> the size for values of type `dyn ExprSchema` cannot be known at
compilation time
> the trait `Sized` is not implemented for `dyn ExprSchema`
--
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]