jayzhan211 commented on code in PR #10193:
URL: https://github.com/apache/datafusion/pull/10193#discussion_r1576108924


##########
datafusion/physical-expr/src/scalar_function.rs:
##########
@@ -142,21 +142,11 @@ impl PhysicalExpr for ScalarFunctionExpr {
     }
 
     fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> {
-        // evaluate the arguments, if there are no arguments we'll instead 
pass in a null array
-        // indicating the batch size (as a convention)
-        let inputs = match self.args.is_empty() {
-            // If the function supports zero argument, we pass in a null array 
indicating the batch size.
-            // This is for user-defined functions.
-            // MakeArray support zero argument but has the different behavior 
from the array with one null.

Review Comment:
   I think we don't need it now, I don't have a strong opinion on whether to 
keep it or not.
   
   > namely to return a single row array (or ColumnarValue)
   
   functions that take 0 args are not restricted to return a single row array.  
I think they can have a function that returns anything as long as is 
`Result<ColumnarValue>`



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to