Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/22390#discussion_r216713161
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
---
@@ -263,10 +263,12 @@ object BooleanSimplification extends
Rule[LogicalPlan] with PredicateHelper {
case TrueLiteral Or _ => TrueLiteral
case _ Or TrueLiteral => TrueLiteral
- case a And b if Not(a).semanticEquals(b) => FalseLiteral
--- End diff --
How about
```
case a And b if Not(a).semanticEquals(b) || a.semanticEquals(Not(b))
=>
if (!a.nullable && !b.nullable) {
FalseLiteral
} else {
If(IsNull(a), Literal.create(null, a.dataType), FalseLiteral)
}
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]