Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-16152

`In` predicate does not work with null values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.6.1
    • None
    • SQL
    • None

    Description

      According to https://github.com/apache/spark/blob/v1.6.1/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala#L134..L136:

       override def eval(input: InternalRow): Any = {
          val evaluatedValue = value.eval(input)
          if (evaluatedValue == null) {
            null
          } else {
            ...
      

      we always return null when the current value is null, ignoring the elements of list. Therefore, we cannot have a predicate which tests whether a column contains values in e.g. [1, 2, 3, null]

      Is this a bug, or is this actually the expected behavior?

      Attachments

        Activity

          People

            Unassigned Unassigned
            fushar Ashar Fuadi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: