jayzhan211 commented on code in PR #10193:
URL: https://github.com/apache/datafusion/pull/10193#discussion_r1575925764
##########
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:
The reason why we need to add special case for `make_array` is that we need
to differentiate empty array `[]` and single null array `[null]`, previously we
avoid additional null array by filter out `make_array`. Now, I think it is even
not a good idea to add specialization to effect every functions, so remove it
at all.
--
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]