simonvandel commented on code in PR #11697:
URL: https://github.com/apache/datafusion/pull/11697#discussion_r1702856870


##########
datafusion/functions/src/core/nullif.rs:
##########
@@ -122,8 +121,13 @@ fn nullif_func(args: &[ColumnarValue]) -> 
Result<ColumnarValue> {
             Ok(ColumnarValue::Array(array))
         }
         (ColumnarValue::Scalar(lhs), ColumnarValue::Array(rhs)) => {
-            let lhs = lhs.to_array_of_size(rhs.len())?;
-            let array = nullif(&lhs, &eq(&lhs, &rhs)?)?;
+            let lhs_s = lhs.to_scalar()?;
+            let lhs_a = lhs.to_array_of_size(rhs.len())?;

Review Comment:
   Specializing arrow-rs's nullif kernel for a constant would be the absolute 
best. But if others can reproduce the small % perf increase of this PR, then 
perhaps it can be merged in isolation?



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

Reply via email to