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



##########
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 understand why you are worried. I reverted back the first case match 
in the next commit. I hope that makes you feel a bit more comfortable...




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