bkietz opened a new issue, #40510:
URL: https://github.com/apache/arrow/issues/40510

   ### Describe the enhancement requested
   
   When called with no arguments, the desired output length of scalar functions 
cannot be determined in general. (For some functions such as `random` we can 
exploit default preallocation of fixed width output to inform the kernel how 
much output to generate, but this approach can't work for all functions.) 
However for the majority of scalar functions which are pure (their output is 
completely determined by their arguments), there is exactly one value 
corresponding to empty arguments. In the context of expression evaluation, 
returning this value as a scalar indicates that the value should be broadcast 
to whatever length is required for the enclosing expression. I think this is a 
more reasonable return value than an empty null array, which is what is 
returned by for example `pa.max_element_wise()`.
   
   Note: explicit Function::is_impure flag added in 
https://github.com/apache/arrow/pull/40396
   
   ### Component(s)
   
   C++


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