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

Incorrect results of casting Struct to String

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.3.0
    • Component/s: SQL
    • Labels:
      None

      Description

      scala> val df = Seq(((1, "a"), 0), ((2, "b"), 0)).toDF("a", "b")
      df: org.apache.spark.sql.DataFrame = [a: struct<_1: int, _2: string>, b: int]
      
      scala> df.write.saveAsTable("t")
                                                                                      
      scala> sql("SELECT CAST(a AS STRING) FROM t").show
      +-------------------+
      |                  a|
      +-------------------+
      |[0,1,1800000001,61]|
      |[0,2,1800000001,62]|
      +-------------------+
      

        Attachments

          Activity

            People

            • Assignee:
              maropu Takeshi Yamamuro
              Reporter:
              maropu Takeshi Yamamuro
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: