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

Function prune_utf8_not_eq

datafusion/pruning/src/pruning_predicate.rs:4549–4603  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4547
4548 #[test]
4549 fn prune_utf8_not_eq() {
4550 let (schema, statistics) = utf8_setup();
4551
4552 let expr = col("s1").not_eq(lit("A"));
4553 #[rustfmt::skip]
4554 let expected_ret = &[
4555 // s1 ["A", "Z"] ==> some rows could pass (must keep)
4556 true,
4557 // s1 ["A", "L"] ==> some rows could pass (must keep)
4558 true,
4559 // s1 ["N", "Z"] ==> all rows must pass (must keep)
4560 true,
4561 // s1 ["M", "M"] ==> all rows must pass (must keep)
4562 true,
4563 // s1 [NULL, NULL] ==> unknown (must keep)
4564 true,
4565 // s1 ["A", NULL] ==> unknown (must keep)
4566 true,
4567 // s1 ["", "A"] ==> some rows could pass (must keep)
4568 true,
4569 // s1 ["", ""] ==> all rows must pass (must keep)
4570 true,
4571 // s1 ["AB", "A\u{10ffff}\u{10ffff}"] ==> all rows must pass (must keep)
4572 true,
4573 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> all rows must pass (must keep)
4574 true,
4575 ];
4576 prune_with_expr(expr, &schema, &statistics, expected_ret);
4577
4578 let expr = col("s1").not_eq(lit(""));
4579 #[rustfmt::skip]
4580 let expected_ret = &[
4581 // s1 ["A", "Z"] ==> all rows must pass (must keep)
4582 true,
4583 // s1 ["A", "L"] ==> all rows must pass (must keep)
4584 true,
4585 // s1 ["N", "Z"] ==> all rows must pass (must keep)
4586 true,
4587 // s1 ["M", "M"] ==> all rows must pass (must keep)
4588 true,
4589 // s1 [NULL, NULL] ==> unknown (must keep)
4590 true,
4591 // s1 ["A", NULL] ==> unknown (must keep)
4592 true,
4593 // s1 ["", "A"] ==> some rows could pass (must keep)
4594 true,
4595 // s1 ["", ""] ==> no rows can pass (not keep)
4596 false,
4597 // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> all rows must pass (must keep)
4598 true,
4599 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> all rows must pass (must keep)
4600 true,
4601 ];
4602 prune_with_expr(expr, &schema, &statistics, expected_ret);
4603 }
4604
4605 #[test]
4606 fn prune_utf8_like_one() {

Callers

nothing calls this directly

Calls 5

utf8_setupFunction · 0.85
prune_with_exprFunction · 0.85
not_eqMethod · 0.80
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…