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

Function prune_missing_statistics

datafusion/pruning/src/pruning_predicate.rs:2537–2555  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 8

newFunction · 0.85
prune_with_exprFunction · 0.85
colFunction · 0.50
litFunction · 0.50
withMethod · 0.45
eqMethod · 0.45
gtMethod · 0.45
ltMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…