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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • 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

              rakson Rakesh Raushan
              rakson Rakesh Raushan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: