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

`stack` should not reject NULL values due to type mismatch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0, 2.0.1, 2.1.0, 2.1.1
    • 2.3.0
    • SQL
    • None

    Description

      Since `stack` function generates a table with nullable columns, it should allow mixed null values.

      scala> sql("select stack(3, 1, 2, 3)").printSchema
      root
       |-- col0: integer (nullable = true)
      
      scala> sql("select stack(3, 1, 2, null)").printSchema
      org.apache.spark.sql.AnalysisException: cannot resolve 'stack(3, 1, 2, NULL)' due to data type mismatch: Argument 1 (IntegerType) != Argument 3 (NullType); line 1 pos 7;
      'Project [unresolvedalias(stack(3, 1, 2, null), None)]
      +- OneRowRelation$
      

      Attachments

        Activity

          People

            dongjoon Dongjoon Hyun
            dongjoon Dongjoon Hyun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: