xudong963 commented on a change in pull request #1249:
URL: https://github.com/apache/arrow-datafusion/pull/1249#discussion_r744284536



##########
File path: datafusion/src/physical_plan/functions.rs
##########
@@ -1223,18 +1231,12 @@ pub fn create_physical_expr(
         // These don't need args and input schema
         _ => create_physical_fun(fun, ctx_state)?,
     };
-    let args = coerce(args, input_schema, &signature(fun))?;
-
-    let arg_types = args
-        .iter()
-        .map(|e| e.data_type(input_schema))
-        .collect::<Result<Vec<_>>>()?;
 
     Ok(Arc::new(ScalarFunctionExpr::new(
         &format!("{}", fun),
         fun_expr,
         args,
-        &return_type(fun, &arg_types)?,
+        &data_type,

Review comment:
       We can still directly use `return_type(fun, &arg_types)?`, don't need 
declare a variable name `data_type`. Because only use it here.




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