()
| 2535 | |
| 2536 | #[test] |
| 2537 | fn prune_missing_statistics() { |
| 2538 | // If the min or max stats are missing we should not prune |
| 2539 | // (unless we know all rows are null, see `prune_all_rows_null_counts`) |
| 2540 | let schema = Arc::new(Schema::new(vec![Field::new("i", DataType::Int32, true)])); |
| 2541 | let container_stats = ContainerStats { |
| 2542 | min: Some(Arc::new(Int32Array::from(vec![None, Some(0)]))), |
| 2543 | max: Some(Arc::new(Int32Array::from(vec![Some(0), None]))), |
| 2544 | null_counts: Some(Arc::new(UInt64Array::from(vec![Some(0), Some(0)]))), |
| 2545 | row_counts: Some(Arc::new(UInt64Array::from(vec![Some(1), Some(1)]))), |
| 2546 | ..ContainerStats::default() |
| 2547 | }; |
| 2548 | let statistics = TestStatistics::new().with("i", container_stats); |
| 2549 | let expected_ret = &[true, true]; |
| 2550 | prune_with_expr(col("i").eq(lit(0)), &schema, &statistics, expected_ret); |
| 2551 | let expected_ret = &[false, true]; |
| 2552 | prune_with_expr(col("i").gt(lit(0)), &schema, &statistics, expected_ret); |
| 2553 | let expected_ret = &[true, false]; |
| 2554 | prune_with_expr(col("i").lt(lit(0)), &schema, &statistics, expected_ret); |
| 2555 | } |
| 2556 | |
| 2557 | #[test] |
| 2558 | fn prune_null_stats() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…