You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/04 13:28:35 UTC
[GitHub] [spark] srowen commented on a diff in pull request #37732: [SPARK-40253] [SQL] Fixed loss of precision for writing 0.00 specific…
srowen commented on code in PR #37732:
URL: https://github.com/apache/spark/pull/37732#discussion_r962314494
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala:
##########
@@ -76,8 +76,19 @@ object Literal {
val decimal = Decimal(d)
Literal(decimal, DecimalType.fromDecimal(decimal))
case d: JavaBigDecimal =>
- val decimal = Decimal(d)
- Literal(decimal, DecimalType.fromDecimal(decimal))
+ Literal(Decimal(d), DecimalType(Math.max(d.precision, d.scale), d.scale()))
+ if (d.abs().compareTo(new JavaBigDecimal("0")) == 0) {
Review Comment:
OK, this is targeted at master though, and there will be no more 2.4 releases
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org