cloud-fan commented on a change in pull request #30222:
URL: https://github.com/apache/spark/pull/30222#discussion_r517094786
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -510,6 +510,10 @@ object SimplifyConditionals extends Rule[LogicalPlan] with
PredicateHelper {
} else {
e.copy(branches = branches.take(i).map(branch => (branch._1,
elseValue)))
}
+
+ case EqualTo(CaseWhen(branches, _), right)
Review comment:
I'm a bit worried about dropping other branches in CASE WHEN.
`a.semanticEquals(b)` means `a` is always equal to `b`. But
`!a.semanticEquals(b)` doesn't mean that `a` will never be equal to `b`.
----------------------------------------------------------------
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]