Skip to content

Commit

Permalink
tests: update filters in join fuzz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
korowa committed Sep 6, 2024
1 parent 5370251 commit 260aab6
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions datafusion/core/tests/fuzz_cases/join_fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,6 @@ async fn test_inner_join_1k() {
.await
}

fn less_than_100_join_filter(schema1: Arc<Schema>, _schema2: Arc<Schema>) -> JoinFilter {
let less_than_100 = Arc::new(BinaryExpr::new(
Arc::new(Column::new("a", 0)),
Operator::Lt,
Arc::new(Literal::new(ScalarValue::from(100))),
)) as _;
let column_indices = vec![ColumnIndex {
index: 0,
side: JoinSide::Left,
}];
let intermediate_schema =
Schema::new(vec![schema1.field_with_name("a").unwrap().to_owned()]);

JoinFilter::new(less_than_100, column_indices, intermediate_schema)
}

fn col_lt_col_filter(schema1: Arc<Schema>, schema2: Arc<Schema>) -> JoinFilter {
let less_filter = Arc::new(BinaryExpr::new(
Arc::new(Column::new("x", 1)),
Expand Down Expand Up @@ -121,7 +105,7 @@ async fn test_inner_join_1k_filtered() {
make_staggered_batches(1000),
make_staggered_batches(1000),
JoinType::Inner,
Some(Box::new(less_than_100_join_filter)),
Some(Box::new(col_lt_col_filter)),
)
.run_test(&[JoinTestType::HjSmj, JoinTestType::NljHj], false)
.await
Expand Down Expand Up @@ -157,7 +141,7 @@ async fn test_left_join_1k_filtered() {
make_staggered_batches(1000),
make_staggered_batches(1000),
JoinType::Left,
Some(Box::new(less_than_100_join_filter)),
Some(Box::new(col_lt_col_filter)),
)
.run_test(&[JoinTestType::HjSmj, JoinTestType::NljHj], false)
.await
Expand All @@ -182,7 +166,7 @@ async fn test_right_join_1k_filtered() {
make_staggered_batches(1000),
make_staggered_batches(1000),
JoinType::Right,
Some(Box::new(less_than_100_join_filter)),
Some(Box::new(col_lt_col_filter)),
)
.run_test(&[JoinTestType::HjSmj, JoinTestType::NljHj], false)
.await
Expand All @@ -206,7 +190,7 @@ async fn test_full_join_1k_filtered() {
make_staggered_batches(1000),
make_staggered_batches(1000),
JoinType::Full,
Some(Box::new(less_than_100_join_filter)),
Some(Box::new(col_lt_col_filter)),
)
.run_test(&[JoinTestType::HjSmj, JoinTestType::NljHj], false)
.await
Expand Down

0 comments on commit 260aab6

Please sign in to comment.