yyy1000 commented on code in PR #9522:
URL: https://github.com/apache/arrow-datafusion/pull/9522#discussion_r1518723049


##########
datafusion/expr/src/udf.rs:
##########
@@ -307,12 +308,17 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
         &self,
         args: &[Expr],
         schema: &dyn ExprSchema,
+        arg_types: &[DataType],
     ) -> Result<DataType> {
-        let arg_types = args
-            .iter()
-            .map(|arg| arg.get_type(schema))
-            .collect::<Result<Vec<_>>>()?;
-        self.return_type(&arg_types)
+        if arg_types.is_empty() {

Review Comment:
   When will `arg_types` not be provided?
   I think in the current PR, we will pass always pass `arg_types` to the 
default implementation of `return_type_from_exprs`, thus it may be alway 
non-empty?



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

Reply via email to