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

Non-nullable null type should not coerce to nullable type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.0.0
    • SQL
    • None

    Description

      scala> spark.range(10).selectExpr("array()").printSchema()
      root
       |-- array(): array (nullable = false)
       |    |-- element: null (containsNull = false)
      
      
      scala> spark.range(10).selectExpr("concat(array()) as arr").printSchema()
      root
       |-- arr: array (nullable = false)
       |    |-- element: null (containsNull = false)
      
      
      scala> spark.range(10).selectExpr("concat(array(), array(1)) as arr").printSchema()
      root
       |-- arr: array (nullable = false)
       |    |-- element: integer (containsNull = true)
      

      The last case should not coerce to nullable type.

      Attachments

        Issue Links

          Activity

            People

              gurwls223 Hyukjin Kwon
              gurwls223 Hyukjin Kwon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: