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 2022/09/16 06:33:26 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #37625: [SPARK-40177][SQL] Simplify condition of form (a==b) || (a==null&&b==null) to a<=>b

cloud-fan commented on code in PR #37625:
URL: https://github.com/apache/spark/pull/37625#discussion_r972659580


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -412,6 +412,16 @@ object BooleanSimplification extends Rule[LogicalPlan] with PredicateHelper {
           }
         }
 
+      case Or(EqualTo(l, r), And(IsNull(c1), IsNull(c2)))

Review Comment:
   Assume that we have a chain of predicates combined by OR `cond1 OR cond2 OR cond3 OR ... condN`. I think we can merge `condX` and `condY` if they are `EqualTo(l, r)` and `And(IsNull(l), isNull(r))`. This is more general than the current approach.



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