You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/12/28 20:06:38 UTC
[GitHub] [spark] viirya commented on a change in pull request #30953: [SPARK-33845][SQL][FOLLOWUP] fix SimplifyConditionals
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org