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

Function prune_utf8_eq

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

Source from the content-addressed store, hash-verified

4490
4491 #[test]
4492 fn prune_utf8_eq() {
4493 let (schema, statistics) = utf8_setup();
4494
4495 let expr = col("s1").eq(lit("A"));
4496 #[rustfmt::skip]
4497 let expected_ret = &[
4498 // s1 ["A", "Z"] ==> some rows could pass (must keep)
4499 true,
4500 // s1 ["A", "L"] ==> some rows could pass (must keep)
4501 true,
4502 // s1 ["N", "Z"] ==> no rows can pass (not keep)
4503 false,
4504 // s1 ["M", "M"] ==> no rows can pass (not keep)
4505 false,
4506 // s1 [NULL, NULL] ==> unknown (must keep)
4507 true,
4508 // s1 ["A", NULL] ==> unknown (must keep)
4509 true,
4510 // s1 ["", "A"] ==> some rows could pass (must keep)
4511 true,
4512 // s1 ["", ""] ==> no rows can pass (not keep)
4513 false,
4514 // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> no rows can pass (not keep)
4515 false,
4516 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> no rows can pass (not keep)
4517 false,
4518 ];
4519 prune_with_expr(expr, &schema, &statistics, expected_ret);
4520
4521 let expr = col("s1").eq(lit(""));
4522 #[rustfmt::skip]
4523 let expected_ret = &[
4524 // s1 ["A", "Z"] ==> no rows can pass (not keep)
4525 false,
4526 // s1 ["A", "L"] ==> no rows can pass (not keep)
4527 false,
4528 // s1 ["N", "Z"] ==> no rows can pass (not keep)
4529 false,
4530 // s1 ["M", "M"] ==> no rows can pass (not keep)
4531 false,
4532 // s1 [NULL, NULL] ==> unknown (must keep)
4533 true,
4534 // s1 ["A", NULL] ==> no rows can pass (not keep)
4535 false,
4536 // s1 ["", "A"] ==> some rows could pass (must keep)
4537 true,
4538 // s1 ["", ""] ==> all rows must pass (must keep)
4539 true,
4540 // s1 ["AB", "A\u{10ffff}\u{10ffff}\u{10ffff}"] ==> no rows can pass (not keep)
4541 false,
4542 // s1 ["A\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"] ==> no rows can pass (not keep)
4543 false,
4544 ];
4545 prune_with_expr(expr, &schema, &statistics, expected_ret);
4546 }
4547
4548 #[test]
4549 fn prune_utf8_not_eq() {

Callers

nothing calls this directly

Calls 5

utf8_setupFunction · 0.85
prune_with_exprFunction · 0.85
colFunction · 0.50
litFunction · 0.50
eqMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…