ZhangHuiGui commented on PR #40687: URL: https://github.com/apache/arrow/pull/40687#issuecomment-2067564022
> Generally, it seems confusing and error-prone that we are treating pure and impure functions differently here. In fact, this issue/PR is just to make the return value of parameterless pure functions more reasonable. > IMHO, this should apply only to varargs scalar functions such as `coalesce,` not genuine nullary functions such as `random`. It's the context in https://github.com/apache/arrow/issues/40510#issue-2184322765 > 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() -- 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]
