cloud-fan commented on code in PR #48300:
URL: https://github.com/apache/spark/pull/48300#discussion_r1796469594
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala:
##########
@@ -2829,6 +2829,38 @@ class AdaptiveQueryExecSuite
assert(findTopLevelBroadcastNestedLoopJoin(adaptivePlan).size == 1)
assert(findTopLevelUnion(adaptivePlan).size == 0)
}
+
+ withSQLConf(
+ SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "100") {
+ withTempView("t1", "t2", "t3", "t4") {
+ Seq(1).toDF().createOrReplaceTempView("t1")
+ spark.range(100).createOrReplaceTempView("t2")
+ spark.range(2).createOrReplaceTempView("t3")
+ spark.range(2).createOrReplaceTempView("t4")
+ val (_, adaptivePlan) = runAdaptiveAndVerifyResult(
+ """
+ |SELECT tt2.value
+ |FROM (
+ | SELECT value
+ | FROM t1
+ | WHERE NOT EXISTS (
+ | SELECT 1
+ | FROM (
+ | SELECT t2.id
+ | FROM t2
+ | JOIN t3 ON t2.id = t3.id
+ | AND t2.id > 100
+ | ) tt
+ | WHERE t1.value = tt.id
+ | )
+ | AND t1.value = 1
+ |) tt2
+ | LEFT JOIN t4 ON tt2.value = t4.id
+ |""".stripMargin
+ )
+ assert(findTopLevelBroadcastNestedLoopJoin(adaptivePlan).size == 1)
Review Comment:
just for record, can you leave a PR comment to show the final spark plan of
this query before and after this PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]