samuelcolvin commented on code in PR #11321:
URL: https://github.com/apache/datafusion/pull/11321#discussion_r1668259962
##########
datafusion/physical-expr/src/expressions/is_null.rs:
##########
@@ -74,9 +77,16 @@ impl PhysicalExpr for IsNullExpr {
fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> {
let arg = self.arg.evaluate(batch)?;
match arg {
- ColumnarValue::Array(array) => Ok(ColumnarValue::Array(Arc::new(
- compute::is_null(array.as_ref())?,
- ))),
+ ColumnarValue::Array(array) => {
+ let bool_array = if let Some(union_array) =
+ array.as_any().downcast_ref::<UnionArray>()
+ {
+ union_is_null(union_array)?
+ } else {
+ compute::is_null(array.as_ref())?
+ };
+ Ok(ColumnarValue::Array(Arc::new(bool_array)))
+ }
Review Comment:
I've done what I think you mean here.
The only material change is that now for the "is not null" case we use
effectively use `compute::not(compute::is_null(...))` instead of
`compute::is_not_null`, I'm not sure if those will compile to the same thing,
or if you care about any resultant differences.
--
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]