Github user davies commented on the pull request: https://github.com/apache/spark/pull/6814#issuecomment-113265946 @mateiz We use DECIMAL128 as the MathContext to create BigDecimal, which has precision as 34, it's lower than 38 in Hive. ``` scala> val d = Decimal(2L<<60, 38, 0) d: org.apache.spark.sql.types.Decimal = 2305843009213693952 scala> d * d res0: org.apache.spark.sql.types.Decimal = 5.316911983139663491615228241121378E+36 scala> (d * d).toJavaBigDecimal.unscaledValue res5: java.math.BigInteger = 5316911983139663491615228241121378 // this is wrong ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org