Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/8983#discussion_r41212281 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala --- @@ -305,12 +305,17 @@ object HiveTypeCoercion { /** * Convert all expressions in in() list to the left operator type + * except when the left operator type is NullType. In case when left hand + * operator type is NullType create a Literal(Null). */ object InConversion extends Rule[LogicalPlan] { def apply(plan: LogicalPlan): LogicalPlan = plan resolveExpressions { // Skip nodes who's children have not been resolved yet. case e if !e.childrenResolved => e + case i @ In(a, b) if (a.dataType == NullType) => + Literal.create(null, BooleanType) --- End diff -- Ah sorry for my mistake. I thought you are casting the `a` to boolean type, but actually you just turn the result to boolean null. Can you reference to a hive doc that says something like "if the value is null, the In operation will always return null"? I think we should follow hive semantic here.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org