zeroshade commented on code in PR #121:
URL: https://github.com/apache/arrow-go/pull/121#discussion_r1754869785


##########
arrow/datatype_fixedwidth.go:
##########
@@ -532,19 +533,74 @@ type DecimalType interface {
        DataType
        GetPrecision() int32
        GetScale() int32
+       BitWidth() int
 }
 
 func NewDecimalType(id Type, prec, scale int32) (DecimalType, error) {
        switch id {
+       case DECIMAL32:
+               debug.Assert(prec <= 
int32(decimal.MaxPrecision[decimal.Decimal32]()), "invalid precision for 
decimal32")

Review Comment:
   The assumption being made is that if a user is explicitly calling 
`NewDecimalType` they know what they are doing, so we only perform the 
precision validation in debug mode for performance. 
   
   



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

Reply via email to