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

Function bool_setup

datafusion/pruning/src/pruning_predicate.rs:3859–3874  ·  view source on GitHub ↗

Creates setup for boolean chunk pruning For predicate "b1" (boolean expr) b1 [false, false] ==> no rows can pass (not keep) b1 [false, true] ==> some rows could pass (must keep) b1 [true, true] ==> all rows must pass (must keep) b1 [NULL, NULL] ==> unknown (must keep) b1 [false, NULL] ==> unknown (must keep) For predicate "!b1" (boolean expr) b1 [false, false] ==> all rows pass (must keep) b1

()

Source from the content-addressed store, hash-verified

3857 /// b1 [NULL, NULL] ==> unknown (must keep)
3858 /// b1 [false, NULL] ==> unknown (must keep)
3859 fn bool_setup() -> (SchemaRef, TestStatistics, Vec<bool>, Vec<bool>) {
3860 let schema =
3861 Arc::new(Schema::new(vec![Field::new("b1", DataType::Boolean, true)]));
3862
3863 let statistics = TestStatistics::new().with(
3864 "b1",
3865 ContainerStats::new_bool(
3866 vec![Some(false), Some(false), Some(true), None, Some(false)], // min
3867 vec![Some(false), Some(true), Some(true), None, None], // max
3868 ),
3869 );
3870 let expected_true = vec![false, true, true, true, true];
3871 let expected_false = vec![true, true, false, true, true];
3872
3873 (schema, statistics, expected_true, expected_false)
3874 }
3875
3876 #[test]
3877 fn prune_bool_const_expr() {

Callers 5

prune_bool_const_exprFunction · 0.85
prune_bool_columnFunction · 0.85
prune_bool_not_columnFunction · 0.85

Calls 2

newFunction · 0.85
withMethod · 0.45

Tested by 5

prune_bool_const_exprFunction · 0.68
prune_bool_columnFunction · 0.68
prune_bool_not_columnFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…