We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86d3e8d commit 9f4002cCopy full SHA for 9f4002c
sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala
@@ -317,8 +317,8 @@ final class Decimal extends Ordered[Decimal] with Serializable {
317
} else {
318
try {
319
// We cannot store Long.MAX_VALUE as a Double without losing precision.
320
- // Simply converting the decimal to `BigInteger` and using the method `longValueExact` can
321
- // guarantee the precision of the range check.
+ // Here we simply convert the decimal to `BigInteger` and use the method
+ // `longValueExact` to make sure the range check is accurate.
322
decimalVal.bigDecimal.toBigInteger.longValueExact()
323
} catch {
324
case _: ArithmeticException => overflowException("long")
0 commit comments