From bc330b92e1dcc30054b5cdc5a949e1a01726e9b4 Mon Sep 17 00:00:00 2001 From: Edmondo Porcu Date: Tue, 4 Jun 2024 07:40:45 -0400 Subject: [PATCH] Adding filtered cases for other tests --- datafusion/core/tests/fuzz_cases/join_fuzz.rs | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/datafusion/core/tests/fuzz_cases/join_fuzz.rs b/datafusion/core/tests/fuzz_cases/join_fuzz.rs index ab5d9fa28d34..96c3af5249a4 100644 --- a/datafusion/core/tests/fuzz_cases/join_fuzz.rs +++ b/datafusion/core/tests/fuzz_cases/join_fuzz.rs @@ -107,6 +107,18 @@ async fn test_left_join_1k() { .await } +#[tokio::test] +async fn test_left_join_1k_filtered() { + JoinFuzzTestCase::new( + make_staggered_batches(1000), + make_staggered_batches(1000), + JoinType::Left, + Some(Box::new(less_than_10_join_filter)), + ) + .run_test() + .await +} + #[tokio::test] async fn test_right_join_1k() { JoinFuzzTestCase::new( @@ -118,6 +130,17 @@ async fn test_right_join_1k() { .run_test() .await } +#[tokio::test] +async fn test_right_join_1k_filtered() { + JoinFuzzTestCase::new( + make_staggered_batches(1000), + make_staggered_batches(1000), + JoinType::Right, + Some(Box::new(less_than_10_join_filter)), + ) + .run_test() + .await +} #[tokio::test] async fn test_full_join_1k() { @@ -131,6 +154,18 @@ async fn test_full_join_1k() { .await } +#[tokio::test] +async fn test_full_join_1k_filtered() { + JoinFuzzTestCase::new( + make_staggered_batches(1000), + make_staggered_batches(1000), + JoinType::Full, + Some(Box::new(less_than_10_join_filter)), + ) + .run_test() + .await +} + #[tokio::test] async fn test_semi_join_1k() { JoinFuzzTestCase::new( @@ -143,6 +178,18 @@ async fn test_semi_join_1k() { .await } +#[tokio::test] +async fn test_semi_join_1k_filtered() { + JoinFuzzTestCase::new( + make_staggered_batches(1000), + make_staggered_batches(1000), + JoinType::LeftSemi, + Some(Box::new(less_than_10_join_filter)), + ) + .run_test() + .await +} + #[tokio::test] async fn test_anti_join_1k() { JoinFuzzTestCase::new( @@ -155,12 +202,26 @@ async fn test_anti_join_1k() { .await } +#[tokio::test] +async fn test_anti_join_1k_filtered() { + JoinFuzzTestCase::new( + make_staggered_batches(1000), + make_staggered_batches(1000), + JoinType::LeftAnti, + Some(Box::new(less_than_10_join_filter)), + ) + .run_test() + .await +} + +type JoinFilterBuilder = Box, Arc) -> JoinFilter>; + struct JoinFuzzTestCase { batch_sizes: &'static [usize], input1: Vec, input2: Vec, join_type: JoinType, - join_filter_builder: Option, Arc) -> JoinFilter>>, + join_filter_builder: Option, } impl JoinFuzzTestCase { @@ -168,7 +229,7 @@ impl JoinFuzzTestCase { input1: Vec, input2: Vec, join_type: JoinType, - join_filter_builder: Option, Arc) -> JoinFilter>>, + join_filter_builder: Option, ) -> Self { Self { batch_sizes: &[1, 2, 7, 49, 50, 51, 100],