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

Function utf8_setup

datafusion/pruning/src/pruning_predicate.rs:4456–4489  ·  view source on GitHub ↗

Creates a setup for chunk pruning, modeling a utf8 column "s1" with 5 different containers (e.g. RowGroups). They have [min, max]: s1 ["A", "Z"] s1 ["A", "L"] s1 ["N", "Z"] s1 [NULL, NULL] s1 ["A", NULL] s1 ["", "A"] s1 ["", ""] s1 ["AB", "A\u{10ffff}"] s1 ["A\u{10ffff}\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"]

()

Source from the content-addressed store, hash-verified

4454 /// s1 ["AB", "A\u{10ffff}"]
4455 /// s1 ["A\u{10ffff}\u{10ffff}\u{10ffff}", "A\u{10ffff}\u{10ffff}"]
4456 fn utf8_setup() -> (SchemaRef, TestStatistics) {
4457 let schema = Arc::new(Schema::new(vec![Field::new("s1", DataType::Utf8, true)]));
4458
4459 let statistics = TestStatistics::new().with(
4460 "s1",
4461 ContainerStats::new_utf8(
4462 vec![
4463 Some("A"),
4464 Some("A"),
4465 Some("N"),
4466 Some("M"),
4467 None,
4468 Some("A"),
4469 Some(""),
4470 Some(""),
4471 Some("AB"),
4472 Some("A\u{10ffff}\u{10ffff}"),
4473 ], // min
4474 vec![
4475 Some("Z"),
4476 Some("L"),
4477 Some("Z"),
4478 Some("M"),
4479 None,
4480 None,
4481 Some("A"),
4482 Some(""),
4483 Some("A\u{10ffff}\u{10ffff}\u{10ffff}"),
4484 Some("A\u{10ffff}\u{10ffff}"),
4485 ], // max
4486 ),
4487 );
4488 (schema, statistics)
4489 }
4490
4491 #[test]
4492 fn prune_utf8_eq() {

Callers 6

prune_utf8_eqFunction · 0.85
prune_utf8_not_eqFunction · 0.85
prune_utf8_like_oneFunction · 0.85
prune_utf8_like_manyFunction · 0.85
prune_utf8_not_like_oneFunction · 0.85
prune_utf8_not_like_manyFunction · 0.85

Calls 2

newFunction · 0.85
withMethod · 0.45

Tested by 6

prune_utf8_eqFunction · 0.68
prune_utf8_not_eqFunction · 0.68
prune_utf8_like_oneFunction · 0.68
prune_utf8_like_manyFunction · 0.68
prune_utf8_not_like_oneFunction · 0.68
prune_utf8_not_like_manyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…