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

Function prune_with_expr

datafusion/pruning/src/pruning_predicate.rs:5703–5714  ·  view source on GitHub ↗

prunes the specified expr with the specified schema and statistics, and ensures it returns expected. `expected` is a vector of bools, where true means the row group should be kept, and false means it should be pruned. TODO refactor other tests to use this to reduce boiler plate

(
        expr: Expr,
        schema: &SchemaRef,
        statistics: &TestStatistics,
        expected: &[bool],
    )

Source from the content-addressed store, hash-verified

5701 /// be kept, and false means it should be pruned.
5702 // TODO refactor other tests to use this to reduce boiler plate
5703 fn prune_with_expr(
5704 expr: Expr,
5705 schema: &SchemaRef,
5706 statistics: &TestStatistics,
5707 expected: &[bool],
5708 ) {
5709 println!("Pruning with expr: {expr}");
5710 let expr = logical2physical(&expr, schema);
5711 let p = PruningPredicate::try_new(expr, Arc::<Schema>::clone(schema)).unwrap();
5712 let result = p.prune(statistics).unwrap();
5713 assert_eq!(result, expected);
5714 }
5715
5716 fn prune_with_simplified_expr(
5717 expr: Expr,

Callers 15

prune_missing_statisticsFunction · 0.85
prune_null_statsFunction · 0.85
prune_decimal_dataFunction · 0.85
prune_apiFunction · 0.85
prune_not_eq_dataFunction · 0.85
prune_bool_const_exprFunction · 0.85
prune_bool_columnFunction · 0.85
prune_bool_not_columnFunction · 0.85

Calls 2

logical2physicalFunction · 0.85
pruneMethod · 0.45

Tested by 15

prune_missing_statisticsFunction · 0.68
prune_null_statsFunction · 0.68
prune_decimal_dataFunction · 0.68
prune_apiFunction · 0.68
prune_not_eq_dataFunction · 0.68
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…