uros-b commented on code in PR #57476:
URL: https://github.com/apache/spark/pull/57476#discussion_r3700459177
##########
sql/api/src/main/scala/org/apache/spark/sql/types/Decimal.scala:
##########
@@ -433,6 +433,8 @@ final class Decimal extends Ordered[Decimal] with
Serializable {
if (doubled > pow10diff || doubled == pow10diff && lv % 2 != 0) {
lv += (if (droppedDigits < 0) -1L else 1L)
}
+ case ROUND_DOWN =>
+ // Truncation toward zero: `lv /= pow10diff` already dropped the
fractional part.
Review Comment:
```suggestion
// Truncation toward zero: `lv /= pow10diff` already dropped
the fractional part.
```
##########
sql/api/src/main/scala/org/apache/spark/sql/types/Decimal.scala:
##########
@@ -433,6 +433,8 @@ final class Decimal extends Ordered[Decimal] with
Serializable {
if (doubled > pow10diff || doubled == pow10diff && lv % 2 != 0) {
lv += (if (droppedDigits < 0) -1L else 1L)
}
+ case ROUND_DOWN =>
+ // Truncation toward zero: `lv /= pow10diff` already dropped the
fractional part.
Review Comment:
The comment in Decimal.scala sits at the case indentation rather than inside
the body; it should be indented one more level to read as the case body.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]