Skip to content

Commit 62a04a3

Browse files
committed
Address PR comment
1 parent 38c7d6e commit 62a04a3

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,23 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite
343343
assert(getNormalizedExplain(df1, FormattedMode) === getNormalizedExplain(df2, FormattedMode))
344344
}
345345
}
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+
}
346363
}
347364

348365
class ExplainSuiteAE extends ExplainSuiteHelper with EnableAdaptiveExecutionSuite {

0 commit comments

Comments
 (0)