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



##########
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:
       Good find! I think we need to correct 
[CartesianProductExec.joinType](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/joins/CartesianProductExec.scala#L65)
 as well.




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



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

Reply via email to