You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/19 02:32:06 UTC

[GitHub] [spark] wangyum commented on a change in pull request #32218: [SPARK-35121][SQL] Enhance EliminateOuterJoin to eliminate outer joins if join condition is not defined

wangyum commented on a change in pull request #32218:
URL: https://github.com/apache/spark/pull/32218#discussion_r615508124



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala
##########
@@ -283,10 +283,13 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
         }
 
         def createCartesianProduct() = {
-          if (joinType.isInstanceOf[InnerLike]) {
-            Some(Seq(joins.CartesianProductExec(planLater(left), planLater(right), condition)))
-          } else {
-            None
+          joinType match {
+            case _: InnerLike =>
+              Some(Seq(joins.CartesianProductExec(planLater(left), planLater(right), condition)))
+            case LeftOuter | RightOuter | FullOuter if condition.isEmpty =>

Review comment:
       It seems we can enhance `EliminateOuterJoin` to make it simpler.




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org