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 2021/03/11 04:24:49 UTC
[GitHub] [spark] ulysses-you commented on a change in pull request #31797: [WIP][SPARK-34692][SQL] Support Not(Int) and Not(InSet) propagate null
ulysses-you commented on a change in pull request #31797:
URL: https://github.com/apache/spark/pull/31797#discussion_r592057418
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/ReplaceNullWithFalseInPredicate.scala
##########
@@ -95,6 +95,11 @@ object ReplaceNullWithFalseInPredicate extends Rule[LogicalPlan] {
private def replaceNullWithFalse(e: Expression): Expression = e match {
case Literal(null, BooleanType) =>
FalseLiteral
+ case Not(In(value, list)) if (value +: list).exists(isNullLiteral) =>
Review comment:
`null in (xxx)` is a special case that we have already handled in `NullPropagation`, but it's better that return the same result whether other rule is excluded. We also add the `value` pattern here.
----------------------------------------------------------------
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