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` extracts 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to