cloud-fan commented on a change in pull request #33930:
URL: https://github.com/apache/spark/pull/33930#discussion_r704913622



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -441,6 +456,24 @@ object BooleanSimplification extends Rule[LogicalPlan] 
with PredicateHelper {
 
       case Not(IsNull(e)) => IsNotNull(e)
       case Not(IsNotNull(e)) => IsNull(e)
+
+      // Using (Not(a) === b) == (a === Not(b)), (Not(a) <=> b) == (a <=> 
Not(b)) rules
+      // E.g. `EqualTo(Not(a), b)` where `b = Not(c)`, it will become
+      // `EqualTo(a, Not(b))` => `EqualTo(a, Not(Not(c)))` => `EqualTo(a, c)`

Review comment:
       then shall we simply match `EqualTo(Not(a), Not(b))` and turn it into 
`EqualTo(a, b)`? The code can be clearer




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