emkornfield commented on a change in pull request #11359:
URL: https://github.com/apache/arrow/pull/11359#discussion_r741365545



##########
File path: go/arrow/array/decimal128.go
##########
@@ -229,6 +253,67 @@ func (b *Decimal128Builder) newData() (data *Data) {
        return
 }
 
+func (b *Decimal128Builder) unmarshalOne(dec *json.Decoder) error {
+       t, err := dec.Token()
+       if err != nil {
+               return err
+       }
+
+       var out *big.Float
+
+       switch v := t.(type) {
+       case float64:
+               out = big.NewFloat(v)
+       case string:
+               out, _, err = big.ParseFloat(v, 10, 0, big.ToNearestAway)

Review comment:
       Also, is 0 the right value for precision here shouldn't it be 128?
   
   Also if I read the docs correctly it seems that this will silently truncate 
decimal values that require larger precision, do you have thoughts on if it 
would be better to check for these types of values and return an error instead?




-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to