Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/9348#discussion_r43469995
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -417,6 +417,11 @@ object NullPropagation extends Rule[LogicalPlan] {
case left :: Literal(null, _) :: Nil => Literal.create(null,
e.dataType)
case _ => e
}
+
+ // If the value expression is NULL then transform the In expression
to
+ // Literal(null)
+ case In(Literal(null, _), list) => Literal.create(null, BooleanType)
--- End diff --
For someone read this PR in the future: we don't need to handle `InSet`
here, because `InSet` requires `list` expressions are all literals, so if the
`value` expression is null literal, the whole `InSet` is foldable and will be
optimized into literal null.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]