jonahgao commented on code in PR #12922:
URL: https://github.com/apache/datafusion/pull/12922#discussion_r1801521103


##########
datafusion/functions/src/macros.rs:
##########
@@ -226,9 +226,8 @@ macro_rules! make_math_unary_udf {
                     $EVALUATE_BOUNDS(inputs)
                 }
 
-                fn invoke(&self, args: &[ColumnarValue]) -> 
Result<ColumnarValue> {
-                    let args = ColumnarValue::values_to_arrays(args)?;
-
+                fn invoke(&self, col_args: &[ColumnarValue]) -> 
Result<ColumnarValue> {

Review Comment:
   According to the definition of a scalar function, it produces a single row 
output for each row of input.
   
https://github.com/apache/datafusion/blob/4a0b7688074880767e1e032400c1e97b7ffcb76e/datafusion/expr/src/udf.rs#L37
   
   I think this example should use `invoke`, and the number of rows produced is 
the same as the number of rows in args. The upper bound arg of the i-th output 
row is taken from the i-th row of args[0].
   



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