File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
sql/core/src/test/scala/org/apache/spark/sql Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,23 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite
343
343
assert(getNormalizedExplain(df1, FormattedMode ) === getNormalizedExplain(df2, FormattedMode ))
344
344
}
345
345
}
346
+
347
+ test(" Coalesced bucket info should be a part of explain string" ) {
348
+ withTable(" t1" , " t2" ) {
349
+ withSQLConf(SQLConf .AUTO_BROADCASTJOIN_THRESHOLD .key -> " 0" ,
350
+ SQLConf .COALESCE_BUCKETS_IN_SORT_MERGE_JOIN_ENABLED .key -> " true" ) {
351
+ Seq (1 , 2 ).toDF(" i" ).write.bucketBy(8 , " i" ).saveAsTable(" t1" )
352
+ Seq (2 , 3 ).toDF(" i" ).write.bucketBy(4 , " i" ).saveAsTable(" t2" )
353
+ val df1 = spark.table(" t1" )
354
+ val df2 = spark.table(" t2" )
355
+ val joined = df1.join(df2, df1(" i" ) === df2(" i" ))
356
+ checkKeywordsExistsInExplain(
357
+ joined,
358
+ SimpleMode ,
359
+ " SelectedBucketsCount: 8 out of 8 (Coalesced to 4)" :: Nil : _* )
360
+ }
361
+ }
362
+ }
346
363
}
347
364
348
365
class ExplainSuiteAE extends ExplainSuiteHelper with EnableAdaptiveExecutionSuite {
You can’t perform that action at this time.
0 commit comments