alamb commented on code in PR #13507:
URL: https://github.com/apache/datafusion/pull/13507#discussion_r1851080564


##########
datafusion/physical-expr/src/scalar_function.rs:
##########
@@ -140,18 +140,23 @@ impl PhysicalExpr for ScalarFunctionExpr {
             .map(|e| e.evaluate(batch))
             .collect::<Result<Vec<_>>>()?;
 
+        let inputs_all_scalars = !inputs.is_empty() && inputs
+            .iter()
+            .all(|arg| matches!(arg, ColumnarValue::Scalar(_)));
+
         // evaluate the function
-        let output = self.fun.invoke_batch(&inputs, batch.num_rows())?;
+        let output = self.fun.invoke_with_args(ScalarFunctionArgs {
+            args: inputs,

Review Comment:
   Eventually we should probably consider doing the same thing for `evaluate` 🤔 



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