cloud-fan commented on code in PR #38760:
URL: https://github.com/apache/spark/pull/38760#discussion_r1031049024


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala:
##########
@@ -420,7 +420,11 @@ final class Decimal extends Ordered[Decimal] with 
Serializable {
       // have overflowed our Long; in either case we must rescale dv to the 
new scale.
       dv = dv.setScale(scale, roundMode)
       if (dv.precision > precision) {

Review Comment:
   I think this makes sense. If we write `SELECT 0bd` in Spark, the returned 
decimal is also `decimal(1, 0)`. Maybe forbidding `decimal(0, 0)` is a better 
choice. What do you think @srielau ? 



-- 
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]

Reply via email to