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

ANSI SQL mode: use plain string representation on casting Decimal to String

    XMLWordPrintableJSON

Details

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

    Description

      Currently, casting decimal as string type will result in Strings with exponential notations if the adjusted exponent is less than -6. This is consistent with BigDecimal.toString https://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html#toString 

      This is different from external databases like PostgreSQL/Oracle/MS SQL server. It doesn't compliant with the ANSI SQL standard either. 

      I suggest always using the plain string in the casting.

      After discussions, I decide to put the new behavior on ANSI SQL mode.

      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: