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

Decimal Math beyond ~2^112 is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.5.0
    • SQL
    • None

    Description

      Here is a snippet from the spark-shell that should not happen

      scala> val d = Decimal(Long.MaxValue,100,0) * Decimal(Long.MaxValue,100,0)
      d: org.apache.spark.sql.types.Decimal = 0
      scala> d.toDebugString
      res3: String = Decimal(expanded,0,1,0})
      

      It looks like precision gets reseted on some operations and values are then truncated.

      Attachments

        Activity

          People

            viirya L. C. Hsieh
            rtreffer Rene Treffer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: