cloud-fan commented on a change in pull request #30953:
URL: https://github.com/apache/spark/pull/30953#discussion_r549446982
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/ReplaceNullWithFalseInPredicate.scala
##########
@@ -56,6 +55,12 @@ object ReplaceNullWithFalseInPredicate extends
Rule[LogicalPlan] {
case d @ DeleteFromTable(_, Some(cond)) => d.copy(condition =
Some(replaceNullWithFalse(cond)))
case u @ UpdateTable(_, _, Some(cond)) => u.copy(condition =
Some(replaceNullWithFalse(cond)))
case p: LogicalPlan => p transformExpressions {
+ // For `EqualNullSafe` with a `TrueLiteral`, whether the other side is
null or false has no
+ // difference, as `null <=> true` and `false <=> true` both return false.
+ case EqualNullSafe(left, TrueLiteral) =>
Review comment:
The change is needed here to not fail the existing tests. When we
convert `If` to `EqualNullSafe`, we should make sure the rule
`ReplaceNullWithFalseInPredicate` still applies.
----------------------------------------------------------------
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]