alamb commented on code in PR #11697:
URL: https://github.com/apache/datafusion/pull/11697#discussion_r1696004686
##########
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:
Maybe we could update the arrow-rs nullif kernel to have a special case for
a constant (arrow-rs calls this idea "Datum" rather than ScalarValue):
https://docs.rs/arrow/latest/arrow/array/trait.Datum.html
But you can get the `Datum` like
this:https://docs.rs/datafusion/latest/datafusion/common/enum.ScalarValue.html#method.to_scalar
--
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]