cloud-fan commented on a change in pull request #30790:
URL: https://github.com/apache/spark/pull/30790#discussion_r544123653
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -523,6 +529,17 @@ object SimplifyConditionals extends Rule[LogicalPlan] with
PredicateHelper {
} else {
e.copy(branches = branches.take(i).map(branch => (branch._1,
elseValue)))
}
+
+ // Null value should be handled by NullPropagation.
Review comment:
It's better to make optimizer rules orthogonal and don't rely on each
other. Let's make `isAlwaysFalse` stricter:
```
exps.forall { e =>
val res = EqualTo(_, equalTo).eval(EmptyRow)
res != null && !res.asInstanceOf[Boolean]
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]