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

Function prune_utf8_like_one

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

Source from the content-addressed store, hash-verified

4604
4605 #[test]
4606 fn prune_utf8_like_one() {
4607 let (schema, statistics) = utf8_setup();
4608
4609 let expr = col("s1").like(lit("A_"));
4610 #[rustfmt::skip]
4611 let expected_ret = &[
4612 // s1 ["A", "Z"] ==> some rows could pass (must keep)
4613 true,
4614 // s1 ["A", "L"] ==> some rows could pass (must keep)
4615 true,
4616 // s1 ["N", "Z"] ==> no rows can pass (not keep)
4617 false,
4618 // s1 ["M", "M"] ==> no rows can pass (not keep)
4619 false,
4620 // s1 [NULL, NULL] ==> unknown (must keep)
4621 true,
4622 // s1 ["A", NULL] ==> unknown (must keep)
4623 true,
4624 // s1 ["", "A"] ==> some rows could pass (must keep)
4625 true,
4626 // s1 ["", ""] ==> no rows can pass (not keep)
4627 false,
4628 // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4629 true,
4630 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4631 true,
4632 ];
4633 prune_with_expr(expr, &schema, &statistics, expected_ret);
4634
4635 let expr = col("s1").like(lit("_A_"));
4636 #[rustfmt::skip]
4637 let expected_ret = &[
4638 // s1 ["A", "Z"] ==> some rows could pass (must keep)
4639 true,
4640 // s1 ["A", "L"] ==> some rows could pass (must keep)
4641 true,
4642 // s1 ["N", "Z"] ==> some rows could pass (must keep)
4643 true,
4644 // s1 ["M", "M"] ==> some rows could pass (must keep)
4645 true,
4646 // s1 [NULL, NULL] ==> unknown (must keep)
4647 true,
4648 // s1 ["A", NULL] ==> unknown (must keep)
4649 true,
4650 // s1 ["", "A"] ==> some rows could pass (must keep)
4651 true,
4652 // s1 ["", ""] ==> some rows could pass (must keep)
4653 true,
4654 // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4655 true,
4656 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4657 true,
4658 ];
4659 prune_with_expr(expr, &schema, &statistics, expected_ret);
4660
4661 let expr = col("s1").like(lit("_"));
4662 #[rustfmt::skip]
4663 let expected_ret = &[

Callers

nothing calls this directly

Calls 5

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