Skip to content

Apache DataFusion SQL Query Engine

replace and(.., not(...)) with and_not(..) (#10885)

RT_Enzyme9b3b80510e7f
diff --git a/datafusion/physical-expr/src/expressions/case.rs b/datafusion/physical-expr/src/expressions/case.rs
index c56229e07a..08d8cd4413 100644
--- a/datafusion/physical-expr/src/expressions/case.rs
+++ b/datafusion/physical-expr/src/expressions/case.rs
@@ -26,7 +26,7 @@ use crate::PhysicalExpr;
use arrow::array::*;
use arrow::compute::kernels::cmp::eq;
use arrow::compute::kernels::zip::zip;
-use arrow::compute::{and, is_null, not, nullif, or, prep_null_mask_filter};
+use arrow::compute::{and, and_not, is_null, not, nullif, or, prep_null_mask_filter};
use arrow::datatypes::{DataType, Schema};
use datafusion_common::cast::as_boolean_array;
use datafusion_common::{exec_err, internal_err, DataFusionError, Result, ScalarValue};
@@ -168,7 +168,7 @@ impl CaseExpr {
}
};
- remainder = and(&remainder, &not(&when_match)?)?;
+ remainder = and_not(&remainder, &when_match)?;
}
if let Some(e) = &self.else_expr {
@@ -241,7 +241,7 @@ impl CaseExpr {
// Succeed tuples should be filtered out for short-circuit evaluation,
// null values for the current when expr should be kept
- remainder = and(&remainder, &not(&when_value)?)?;
+ remainder = and_not(&remainder, &when_value)?;
}
if let Some(e) = &self.else_expr {