jkosh44 commented on code in PR #14289:
URL: https://github.com/apache/datafusion/pull/14289#discussion_r1936605304


##########
datafusion/physical-expr/src/scalar_function.rs:
##########
@@ -186,6 +187,15 @@ impl PhysicalExpr for ScalarFunctionExpr {
             .map(|e| e.evaluate(batch))
             .collect::<Result<Vec<_>>>()?;
 
+        if self.fun.signature().null_handling == NullHandling::Propagate
+            && args.iter().any(
+                |arg| matches!(arg, ColumnarValue::Scalar(scalar) if 
scalar.is_null()),

Review Comment:
   Ok, I think I understand this now. If the function is called with a single 
set of arguments then each arg will be a `ColumnarValue::Scalar`. However, if 
the function is called on a batch of arguments, then each arg will be a 
`ColumnarValue::Array` of all the arguments. So this does not work in the batch 
case.
   
   What we'd really like is to identify all indexes, `i`, s.t. one of the args 
at index `i` is `Null`. Then somehow skip all rows at the identified indexes 
and immediately return `Null` for those. That seems a little tricky because it 
looks like we pass the entire `ArrayRef` to the function implementation.



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