kazuyukitanimura commented on a change in pull request #33930:
URL: https://github.com/apache/spark/pull/33930#discussion_r706359662



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/planning/patterns.scala
##########
@@ -404,20 +404,25 @@ object ExtractSingleColumnNullAwareAntiJoin extends 
JoinSelectionHelper with Pre
    * which is very time consuming because it's an O(M*N) calculation.
    * But if it's a single column case O(M*N) calculation could be optimized 
into O(M)
    * using hash lookup instead of loop lookup.
+   *
+   * [SPARK-36665] IsNull(EqualTo(a=b)) gets optimized to Or(IsNull(a), 
IsNull(b))
+   * In addition, it is possible that Or(IsNull(a), IsNull(b)) gets optimized 
to IsNull(a)
+   * when a is nullable and b is not, vice versa
    */
   def unapply(join: Join): Option[ReturnType] = join match {
     case Join(left, right, LeftAnti,
-      Some(Or(e @ EqualTo(leftAttr: Expression, rightAttr: Expression),
-        IsNull(e2 @ EqualTo(_, _)))), _)
+      Some(Or(e @ EqualTo(leftAttr: Expression, rightAttr: Expression), 
IsNull(e2))), _)

Review comment:
       I reverted it as I made it unaryExpressions only




-- 
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-unsubscr...@spark.apache.org

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