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],
)
| 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, |
searching dependent graphs…