MCPcopy Create free account
hub / github.com/apache/datafusion / test_negate_comparison

Function test_negate_comparison

datafusion/physical-expr/src/simplifier/mod.rs:254–272  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

252
253 #[test]
254 fn test_negate_comparison() -> Result<()> {
255 let schema = not_test_schema();
256 let simplifier = PhysicalExprSimplifier::new(&schema);
257
258 // NOT(c = 5) -> c != 5
259 let not_eq = Arc::new(NotExpr::new(Arc::new(BinaryExpr::new(
260 col("c", &schema)?,
261 Operator::Eq,
262 lit(ScalarValue::Int32(Some(5))),
263 ))));
264 let expected = Arc::new(BinaryExpr::new(
265 col("c", &schema)?,
266 Operator::NotEq,
267 lit(ScalarValue::Int32(Some(5))),
268 ));
269 assert_not_simplify(&simplifier, not_eq, expected);
270
271 Ok(())
272 }
273
274 #[test]
275 fn test_demorgans_law_and() -> Result<()> {

Callers

nothing calls this directly

Calls 5

not_test_schemaFunction · 0.85
newFunction · 0.85
assert_not_simplifyFunction · 0.85
colFunction · 0.50
litFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…