[GitHub] [spark] gatorsmile commented on a change in pull request #29035: [SPARK-32220][SQL]SHUFFLE_REPLICATE_NL Hint should not change Non-Cartesian Product join result

2020-07-13 Thread GitBox


gatorsmile commented on a change in pull request #29035:
URL: https://github.com/apache/spark/pull/29035#discussion_r453469535



##
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala
##
@@ -159,7 +159,7 @@ abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
   //   4. Pick cartesian product if join type is inner like.
   //   5. Pick broadcast nested loop join as the final solution. It may 
OOM but we don't have
   //  other choice.
-  case ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, condition, left, 
right, hint) =>
+  case p @ ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, condition, 
left, right, hint) =>

Review comment:
   To avoid making the similar mistakes, we need to rename `condition` to a 
self-descriptive name. "otherConditions"? It is a little bit hard to name it TBH
   





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



[GitHub] [spark] gatorsmile commented on a change in pull request #29035: [SPARK-32220][SQL]SHUFFLE_REPLICATE_NL Hint should not change Non-Cartesian Product join result

2020-07-13 Thread GitBox


gatorsmile commented on a change in pull request #29035:
URL: https://github.com/apache/spark/pull/29035#discussion_r453468999



##
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala
##
@@ -199,7 +199,7 @@ abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
 
 def createCartesianProduct() = {
   if (joinType.isInstanceOf[InnerLike]) {
-Some(Seq(joins.CartesianProductExec(planLater(left), 
planLater(right), condition)))
+Some(Seq(joins.CartesianProductExec(planLater(left), 
planLater(right), p.condition)))

Review comment:
   We need to write a comment above this line and explain what it is doing. 
   // instead of using the condition extracted by ExtractEquiJoinKeys, we 
should use the original join condition, i.e., "p.condition". 





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