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

Incorrect results of not(eqNullSafe) when data read from Parquet file

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.1, 3.0.0
    • Component/s: SQL
    • Labels:
    • Environment:

      Local installation of Spark on Linux (Java 1.8, Ubuntu 18.04).

    • Target Version/s:

      Description

      Example code (spark-shell from Spark 2.4.0):

      scala> Seq("A", "A", null).toDS.repartition(1).write.parquet("t")
      
      scala> spark.read.parquet("t").where(not(col("value").eqNullSafe("A"))).show
      +-----+
      |value|
      +-----+
      +-----+
      

      Running the same with Spark 2.2.0 or 2.3.2 gives the correct result:

      scala> spark.read.parquet("t").where(not(col("value").eqNullSafe("A"))).show
      +-----+
      |value|
      +-----+
      | null|
      +-----+
      
      

      Also, with a different input sequence and Spark 2.4.0 we get the correct result:

      scala> Seq("A", null).toDS.repartition(1).write.parquet("t")
      
      scala> spark.read.parquet("t").where(not(col("value").eqNullSafe("A"))).show
      +-----+
      |value|
      +-----+
      | null|
      +-----+
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rdblue Ryan Blue
                Reporter:
                kapalka Michal Kapalka
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: