viirya commented on a change in pull request #29484:
URL: https://github.com/apache/spark/pull/29484#discussion_r474983424
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala
##########
@@ -1181,4 +1183,26 @@ class AdaptiveQueryExecSuite
checkNumLocalShuffleReaders(adaptivePlan)
}
}
+
+ test("SPARK-32649: Eliminate inner and semi join to empty relation") {
+ withSQLConf(
+ SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true",
+ SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80") {
+ Seq(
+ // inner join (small table at right side)
+ "SELECT * FROM testData t1 join testData3 t2 ON t1.key = t2.a WHERE
t2.b = 1",
+ // inner join (small table at left side)
+ "SELECT * FROM testData3 t1 join testData t2 ON t1.a = t2.key WHERE
t1.b = 1",
+ // left semi join
+ "SELECT * FROM testData t1 left semi join testData3 t2 ON t1.key =
t2.a AND t2.b = 1"
+ ).foreach(query => {
+ val (plan, adaptivePlan) = runAdaptiveAndVerifyResult(query)
+ val smj = findTopLevelSortMergeJoin(plan)
Review comment:
SortMergeJoin? I think this targets BHJ and SHJ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]