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/10/25 09:19:49 UTC

[GitHub] [spark] tanelk commented on a change in pull request #28642: [SPARK-31809][SQL] Infer IsNotNull from join condition

tanelk commented on a change in pull request #28642:
URL: https://github.com/apache/spark/pull/28642#discussion_r735412472



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
##########
@@ -1102,30 +1103,43 @@ object InferFiltersFromConstraints extends Rule[LogicalPlan]
         filter
       }
 
-    case join @ Join(left, right, joinType, conditionOpt, _) =>
-      joinType match {
-        // For inner join, we can infer additional filters for both sides. LeftSemi is kind of an
-        // inner join, it just drops the right side in the final output.
-        case _: InnerLike | LeftSemi =>
-          val allConstraints = getAllConstraints(left, right, conditionOpt)
-          val newLeft = inferNewFilter(left, allConstraints)
-          val newRight = inferNewFilter(right, allConstraints)
-          join.copy(left = newLeft, right = newRight)
+    case join @ ExtractEquiJoinKeys(_, leftKeys, rightKeys, _, _, _, _) =>

Review comment:
       `ExtractEquiJoinKeys` also extract keys, that are compared with `EqualNullSafe` - we should not infer `IsNotNull` for those.




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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