Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33354 New explicit cast syntax rules in ANSI mode
  3. SPARK-34856

ANSI mode: Allow casting complex types as string type

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.2.0
    • SQL
    • None

    Description

      Currently, complex types are not allowed to cast as string type. This breaks the Dataset.show() API. E.g

      scala> sql(“select array(1, 2, 2)“).show(false)
      org.apache.spark.sql.AnalysisException: cannot resolve ‘CAST(`array(1, 2, 2)` AS STRING)’ due to data type mismatch:
       cannot cast array<int> to string with ANSI mode on.
      

      Attachments

        Activity

          People

            Gengliang.Wang Gengliang Wang
            Gengliang.Wang Gengliang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: