mgaido91 commented on a change in pull request #21599: [SPARK-26218][SQL]
Overflow on arithmetic operations returns incorrect result
URL: https://github.com/apache/spark/pull/21599#discussion_r309238587
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/types/DecimalSuite.scala
##########
@@ -94,8 +94,8 @@ class DecimalSuite extends SparkFunSuite with
PrivateMethodTester {
checkValues(Decimal(2e18.toLong), 2e18, 2e18.toLong)
checkValues(Decimal(Long.MaxValue), Long.MaxValue.toDouble, Long.MaxValue)
checkValues(Decimal(Long.MinValue), Long.MinValue.toDouble, Long.MinValue)
- checkValues(Decimal(Double.MaxValue), Double.MaxValue, 0L)
- checkValues(Decimal(Double.MinValue), Double.MinValue, 0L)
+ assert(Decimal(Double.MaxValue).toDouble == Double.MaxValue)
+ assert(Decimal(Double.MinValue).toDouble == Double.MinValue)
Review comment:
yes, I can revert these changes and the tests pass, but here we are
basically checking that we are returning wrong values, so I don't think it
makes any sense. Anyway I can revert the change if you think we should.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]