sathiyapk commented on a change in pull request #34593:
URL: https://github.com/apache/spark/pull/34593#discussion_r754670983
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala
##########
@@ -413,6 +413,18 @@ final class Decimal extends Ordered[Decimal] with
Serializable {
if (doubled > pow10diff || doubled == pow10diff && longVal % 2 !=
0) {
longVal += (if (droppedDigits < 0) -1L else 1L)
}
+ case ROUND_UP =>
Review comment:
Hi @sarutak thanks for your review. Out of curiosity, may i know why it
will be a bug if `changePrecision` takes `ROUND_UP`, `ROUND_DOWN` or
`ROUND_HALF_DOWN` ?
So we could do something like this :
```
case ROUND_UP | ROUND_DOWN | ROUND_HALF_DOWN | _ =>
throw QueryExecutionErrors.unsupportedRoundingMode(roundMode)
```
--
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]