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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.0.1, 2.1.0, 2.1.1
    • Fix Version/s: 2.3.0
    • Component/s: SQL
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: