You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by dongjoon-hyun <gi...@git.apache.org> on 2018/08/08 19:56:15 UTC
[GitHub] spark pull request #22029: [SPARK-24395][SQL] IN operator should return NULL...
Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/22029#discussion_r208714268
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala ---
@@ -240,20 +242,25 @@ case class In(value: Expression, list: Seq[Expression]) extends Predicate {
lazy val inSetConvertible = list.forall(_.isInstanceOf[Literal])
private lazy val ordering = TypeUtils.getInterpretedOrdering(value.dataType)
- override def nullable: Boolean = children.exists(_.nullable)
+ override def nullable: Boolean = value.dataType match {
+ case _: StructType if !SQLConf.get.inFalseForNullField =>
+ children.exists(_.nullable) ||
+ children.exists(_.dataType.asInstanceOf[StructType].exists(_.nullable))
--- End diff --
@mgaido91 . Ur, this `asInstanceOf[StructType]` looks unsafe for non-nullable primitive type. Could you add an additional test case for the nested `StructType` to provide the coverage for this line?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org