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

Throw Exception when invalid string is cast to decimal in ANSI mode

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Component/s: SQL
    • Labels:
      None

      Description

      When spark.sql.ansi.enabled is set,

      If we run select cast('str' as decimal), spark-sql outputs NULL. 

      The ANSI SQL standard requires to throw exception when invalid strings are cast to numbers.

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rakson Rakesh Raushan
                Reporter:
                rakson Rakesh Raushan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: