viirya commented on a change in pull request #30953:
URL: https://github.com/apache/spark/pull/30953#discussion_r549472010
##########
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:
`NullPropagation` should optimize `EqualNullSafe(null, TrueLiteral)` to
false too, isn't?
----------------------------------------------------------------
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]