cloud-fan commented on a change in pull request #24331: [SPARK-19712][SQL] 
Pushdown LeftSemi/LeftAnti below join
URL: https://github.com/apache/spark/pull/24331#discussion_r275750989
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/LeftSemiAntiJoinPushDownSuite.scala
 ##########
 @@ -314,4 +315,155 @@ class LeftSemiPushdownSuite extends PlanTest {
     val optimized = Optimize.execute(originalQuery.analyze)
     comparePlans(optimized, originalQuery.analyze)
   }
+
+  Seq(LeftSemi, LeftAnti).foreach { case outerJT =>
+    Seq(Inner, LeftOuter, Cross).foreach { case innerJT =>
+      test(s"$outerJT pushdown with empty join condition join type $innerJT") {
+        val joinedRelation = testRelation1.join(testRelation2, joinType = 
innerJT, None)
+        val originalQuery = joinedRelation.join(testRelation, joinType = 
outerJT, None)
+        val optimized = Optimize.execute(originalQuery.analyze)
+
+        val pushedDownJoin = testRelation1.join(testRelation, joinType = 
outerJT, None)
+        val correctAnswer = pushedDownJoin.join(testRelation2, joinType = 
innerJT, None)
+        comparePlans(optimized, correctAnswer)
+      }
+    }
+  }
+
+  Seq(LeftSemi, LeftAnti).foreach { case jt =>
+      test(s"$jt pushdown with empty join condition join type RightOuter") {
 
 Review comment:
   can we merge the test case with above? something like
   ```
   val correctAnswer = if (innerJT = RightOuter) {
     ...
   } else {
     ...
   }
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to