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

Function prune_utf8_like_many

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

Source from the content-addressed store, hash-verified

4713
4714 #[test]
4715 fn prune_utf8_like_many() {
4716 let (schema, statistics) = utf8_setup();
4717
4718 let expr = col("s1").like(lit("A%"));
4719 #[rustfmt::skip]
4720 let expected_ret = &[
4721 // s1 ["A", "Z"] ==> some rows could pass (must keep)
4722 true,
4723 // s1 ["A", "L"] ==> some rows could pass (must keep)
4724 true,
4725 // s1 ["N", "Z"] ==> no rows can pass (not keep)
4726 false,
4727 // s1 ["M", "M"] ==> no rows can pass (not keep)
4728 false,
4729 // s1 [NULL, NULL] ==> unknown (must keep)
4730 true,
4731 // s1 ["A", NULL] ==> unknown (must keep)
4732 true,
4733 // s1 ["", "A"] ==> some rows could pass (must keep)
4734 true,
4735 // s1 ["", ""] ==> no rows can pass (not keep)
4736 false,
4737 // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4738 true,
4739 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4740 true,
4741 ];
4742 prune_with_expr(expr, &schema, &statistics, expected_ret);
4743
4744 let expr = col("s1").like(lit("%A%"));
4745 #[rustfmt::skip]
4746 let expected_ret = &[
4747 // s1 ["A", "Z"] ==> some rows could pass (must keep)
4748 true,
4749 // s1 ["A", "L"] ==> some rows could pass (must keep)
4750 true,
4751 // s1 ["N", "Z"] ==> some rows could pass (must keep)
4752 true,
4753 // s1 ["M", "M"] ==> some rows could pass (must keep)
4754 true,
4755 // s1 [NULL, NULL] ==> unknown (must keep)
4756 true,
4757 // s1 ["A", NULL] ==> unknown (must keep)
4758 true,
4759 // s1 ["", "A"] ==> some rows could pass (must keep)
4760 true,
4761 // s1 ["", ""] ==> some rows could pass (must keep)
4762 true,
4763 // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4764 true,
4765 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> some rows could pass (must keep)
4766 true,
4767 ];
4768 prune_with_expr(expr, &schema, &statistics, expected_ret);
4769
4770 let expr = col("s1").like(lit("%"));
4771 #[rustfmt::skip]
4772 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…