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

Add support for IS [NOT] DISTINCT FROM to SPARK SQL

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.3.0
    • SQL
    • None

    Description

      Add support for the SQL standard distinct predicate to SPARK SQL.

      <expression> IS [NOT] DISTINCT FROM <expression>
      
      data = [(10, 20), (30, 30), (40, None), (None, None)]
      df = sc.parallelize(data).toDF(["c1", "c2"])
      df.createTempView("df")
      spark.sql("select c1, c2 from df where c1 is not distinct from c2").collect()
      [Row(c1=30, c2=30), Row(c1=None, c2=None)]
      

      Attachments

        Activity

          People

            ptkool Michael Styles
            ptkool Michael Styles
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: