Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted-Jiang committed Apr 9, 2024
1 parent 11567d9 commit 93f9bea
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions datafusion/core/tests/parquet/row_group_pruning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ async fn test_row_group_with_null_values() {

// After pruning, only row group 2 should be selected
RowGroupPruningTest::new()
.with_scenario(Scenario::AllNullValues)
.with_scenario(Scenario::WithNullValues)
.with_query("SELECT * FROM t WHERE \"i8\" <= 5")
.with_expected_errors(Some(0))
.with_matched_by_stats(Some(1))
Expand All @@ -1287,7 +1287,7 @@ async fn test_row_group_with_null_values() {

// After pruning, only row group 1,3 should be selected
RowGroupPruningTest::new()
.with_scenario(Scenario::AllNullValues)
.with_scenario(Scenario::WithNullValues)
.with_query("SELECT * FROM t WHERE \"i8\" is Null")
.with_expected_errors(Some(0))
.with_matched_by_stats(Some(2))
Expand All @@ -1297,4 +1297,30 @@ async fn test_row_group_with_null_values() {
.with_pruned_by_bloom_filter(Some(0))
.test_row_group_prune()
.await;

// After pruning, only row group 2should be selected
RowGroupPruningTest::new()
.with_scenario(Scenario::WithNullValues)
.with_query("SELECT * FROM t WHERE \"i16\" is Not Null")
.with_expected_errors(Some(0))
.with_matched_by_stats(Some(1))
.with_pruned_by_stats(Some(2))
.with_expected_rows(5)
.with_matched_by_bloom_filter(Some(0))
.with_pruned_by_bloom_filter(Some(0))
.test_row_group_prune()
.await;

// All row groups will be pruned
RowGroupPruningTest::new()
.with_scenario(Scenario::WithNullValues)
.with_query("SELECT * FROM t WHERE \"i32\" > 7")
.with_expected_errors(Some(0))
.with_matched_by_stats(Some(0))
.with_pruned_by_stats(Some(3))
.with_expected_rows(0)
.with_matched_by_bloom_filter(Some(0))
.with_pruned_by_bloom_filter(Some(0))
.test_row_group_prune()
.await;
}

0 comments on commit 93f9bea

Please sign in to comment.