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

Type coercion between ArrayTypes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.2.0
    • SQL
    • None

    Description

      It seems currently we don't allow type coercion between arrays. We now implicitly cast it in SPARK-18624

      So, the below codes are not working now.

      Seq(Array(1)).toDF("a").selectExpr("greatest(a, array(1D))")
      Seq(Array(1)).toDF("a").selectExpr("least(a, array(1D))")
      sql("SELECT * FROM values (array(0)), (array(1D)) as data(a)")
      Seq(Array(1)).toDF("a").union(Seq(Array(1D)).toDF("b"))
      sql("SELECT IF(1=1, array(1), array(1D))")
      

      Attachments

        Issue Links

          Activity

            People

              hyukjin.kwon Hyukjin Kwon
              hyukjin.kwon Hyukjin Kwon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: