@@ -41,6 +41,7 @@ use datafusion::physical_plan::joins::{
41
41
} ;
42
42
use datafusion:: physical_plan:: memory:: MemoryExec ;
43
43
44
+ use crate :: fuzz_cases:: join_fuzz:: JoinTestType :: { HjSmj , NljHj } ;
44
45
use datafusion:: prelude:: { SessionConfig , SessionContext } ;
45
46
use test_utils:: stagger_batch_with_seed;
46
47
@@ -96,7 +97,7 @@ async fn test_inner_join_1k_filtered() {
96
97
JoinType :: Inner ,
97
98
Some ( Box :: new ( col_lt_col_filter) ) ,
98
99
)
99
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
100
+ . run_test ( & [ HjSmj , NljHj ] , false )
100
101
. await
101
102
}
102
103
@@ -108,7 +109,7 @@ async fn test_inner_join_1k() {
108
109
JoinType :: Inner ,
109
110
None ,
110
111
)
111
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
112
+ . run_test ( & [ HjSmj , NljHj ] , false )
112
113
. await
113
114
}
114
115
@@ -120,7 +121,7 @@ async fn test_left_join_1k() {
120
121
JoinType :: Left ,
121
122
None ,
122
123
)
123
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
124
+ . run_test ( & [ HjSmj , NljHj ] , false )
124
125
. await
125
126
}
126
127
@@ -132,7 +133,7 @@ async fn test_left_join_1k_filtered() {
132
133
JoinType :: Left ,
133
134
Some ( Box :: new ( col_lt_col_filter) ) ,
134
135
)
135
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
136
+ . run_test ( & [ HjSmj , NljHj ] , false )
136
137
. await
137
138
}
138
139
@@ -144,7 +145,7 @@ async fn test_right_join_1k() {
144
145
JoinType :: Right ,
145
146
None ,
146
147
)
147
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
148
+ . run_test ( & [ HjSmj , NljHj ] , false )
148
149
. await
149
150
}
150
151
@@ -156,7 +157,7 @@ async fn test_right_join_1k_filtered() {
156
157
JoinType :: Right ,
157
158
Some ( Box :: new ( col_lt_col_filter) ) ,
158
159
)
159
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
160
+ . run_test ( & [ HjSmj , NljHj ] , false )
160
161
. await
161
162
}
162
163
@@ -168,21 +169,19 @@ async fn test_full_join_1k() {
168
169
JoinType :: Full ,
169
170
None ,
170
171
)
171
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
172
+ . run_test ( & [ HjSmj , NljHj ] , false )
172
173
. await
173
174
}
174
175
175
176
#[ tokio:: test]
176
- // flaky for HjSmj case
177
- // https://github.com/apache/datafusion/issues/12359
178
177
async fn test_full_join_1k_filtered ( ) {
179
178
JoinFuzzTestCase :: new (
180
179
make_staggered_batches ( 1000 ) ,
181
180
make_staggered_batches ( 1000 ) ,
182
181
JoinType :: Full ,
183
182
Some ( Box :: new ( col_lt_col_filter) ) ,
184
183
)
185
- . run_test ( & [ JoinTestType :: NljHj ] , false )
184
+ . run_test ( & [ NljHj , HjSmj ] , false )
186
185
. await
187
186
}
188
187
@@ -194,7 +193,7 @@ async fn test_semi_join_1k() {
194
193
JoinType :: LeftSemi ,
195
194
None ,
196
195
)
197
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
196
+ . run_test ( & [ HjSmj , NljHj ] , false )
198
197
. await
199
198
}
200
199
@@ -206,7 +205,7 @@ async fn test_semi_join_1k_filtered() {
206
205
JoinType :: LeftSemi ,
207
206
Some ( Box :: new ( col_lt_col_filter) ) ,
208
207
)
209
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
208
+ . run_test ( & [ HjSmj , NljHj ] , false )
210
209
. await
211
210
}
212
211
@@ -218,7 +217,7 @@ async fn test_anti_join_1k() {
218
217
JoinType :: LeftAnti ,
219
218
None ,
220
219
)
221
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
220
+ . run_test ( & [ HjSmj , NljHj ] , false )
222
221
. await
223
222
}
224
223
@@ -230,7 +229,7 @@ async fn test_anti_join_1k_filtered() {
230
229
JoinType :: LeftAnti ,
231
230
Some ( Box :: new ( col_lt_col_filter) ) ,
232
231
)
233
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
232
+ . run_test ( & [ HjSmj , NljHj ] , false )
234
233
. await
235
234
}
236
235
@@ -242,7 +241,7 @@ async fn test_left_mark_join_1k() {
242
241
JoinType :: LeftMark ,
243
242
None ,
244
243
)
245
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
244
+ . run_test ( & [ HjSmj , NljHj ] , false )
246
245
. await
247
246
}
248
247
@@ -254,7 +253,7 @@ async fn test_left_mark_join_1k_filtered() {
254
253
JoinType :: LeftMark ,
255
254
Some ( Box :: new ( col_lt_col_filter) ) ,
256
255
)
257
- . run_test ( & [ JoinTestType :: HjSmj , JoinTestType :: NljHj ] , false )
256
+ . run_test ( & [ HjSmj , NljHj ] , false )
258
257
. await
259
258
}
260
259
@@ -512,8 +511,8 @@ impl JoinFuzzTestCase {
512
511
nlj_formatted_sorted. sort_unstable ( ) ;
513
512
514
513
if debug
515
- && ( ( join_tests. contains ( & JoinTestType :: NljHj ) && nlj_rows != hj_rows)
516
- || ( join_tests. contains ( & JoinTestType :: HjSmj ) && smj_rows != hj_rows) )
514
+ && ( ( join_tests. contains ( & NljHj ) && nlj_rows != hj_rows)
515
+ || ( join_tests. contains ( & HjSmj ) && smj_rows != hj_rows) )
517
516
{
518
517
let fuzz_debug = "fuzz_test_debug" ;
519
518
std:: fs:: remove_dir_all ( fuzz_debug) . unwrap_or ( ( ) ) ;
@@ -533,7 +532,7 @@ impl JoinFuzzTestCase {
533
532
"input2" ,
534
533
) ;
535
534
536
- if join_tests. contains ( & JoinTestType :: NljHj ) && nlj_rows != hj_rows {
535
+ if join_tests. contains ( & NljHj ) && nlj_rows != hj_rows {
537
536
println ! ( "=============== HashJoinExec ==================" ) ;
538
537
hj_formatted_sorted. iter ( ) . for_each ( |s| println ! ( "{}" , s) ) ;
539
538
println ! ( "=============== NestedLoopJoinExec ==================" ) ;
@@ -551,7 +550,7 @@ impl JoinFuzzTestCase {
551
550
) ;
552
551
}
553
552
554
- if join_tests. contains ( & JoinTestType :: HjSmj ) && smj_rows != hj_rows {
553
+ if join_tests. contains ( & HjSmj ) && smj_rows != hj_rows {
555
554
println ! ( "=============== HashJoinExec ==================" ) ;
556
555
hj_formatted_sorted. iter ( ) . for_each ( |s| println ! ( "{}" , s) ) ;
557
556
println ! ( "=============== SortMergeJoinExec ==================" ) ;
@@ -570,7 +569,7 @@ impl JoinFuzzTestCase {
570
569
}
571
570
}
572
571
573
- if join_tests. contains ( & JoinTestType :: NljHj ) {
572
+ if join_tests. contains ( & NljHj ) {
574
573
let err_msg_rowcnt = format ! ( "NestedLoopJoinExec and HashJoinExec produced different row counts, batch_size: {}" , batch_size) ;
575
574
assert_eq ! ( nlj_rows, hj_rows, "{}" , err_msg_rowcnt. as_str( ) ) ;
576
575
@@ -591,7 +590,7 @@ impl JoinFuzzTestCase {
591
590
}
592
591
}
593
592
594
- if join_tests. contains ( & JoinTestType :: HjSmj ) {
593
+ if join_tests. contains ( & HjSmj ) {
595
594
let err_msg_row_cnt = format ! ( "HashJoinExec and SortMergeJoinExec produced different row counts, batch_size: {}" , & batch_size) ;
596
595
assert_eq ! ( hj_rows, smj_rows, "{}" , err_msg_row_cnt. as_str( ) ) ;
597
596
0 commit comments