Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-38013][SQL][TEST] AQE can change bhj to smj if no extra shuffle introduce #35353

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,29 @@ class AdaptiveQueryExecSuite
}
}

test("Change broadcast join to merge join") {
withTable("t1", "t2") {
withSQLConf(
SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "10000",
SQLConf.ADAPTIVE_AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1",
SQLConf.SHUFFLE_PARTITIONS.key -> "1") {
sql("CREATE TABLE t1 USING PARQUET AS SELECT 1 c1")
sql("CREATE TABLE t2 USING PARQUET AS SELECT 1 c1")
val (plan, adaptivePlan) = runAdaptiveAndVerifyResult(
"""
|SELECT * FROM (
| SELECT distinct c1 from t1
| ) tmp1 JOIN (
| SELECT distinct c1 from t2
| ) tmp2 ON tmp1.c1 = tmp2.c1
|""".stripMargin)
assert(findTopLevelBroadcastHashJoin(plan).size == 1)
assert(findTopLevelBroadcastHashJoin(adaptivePlan).isEmpty)
assert(findTopLevelSortMergeJoin(adaptivePlan).size == 1)
}
}
}

test("Reuse the parallelism of coalesced shuffle in local shuffle read") {
withSQLConf(
SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true",
Expand Down