mrkn commented on code in PR #13377:
URL: https://github.com/apache/arrow/pull/13377#discussion_r901053447


##########
ruby/red-arrow/lib/arrow/array-builder.rb:
##########
@@ -121,15 +126,28 @@ def detect_builder_info(value, builder_info)
             detected: true,
           }
         when BigDecimal
-          if value.to_arrow.is_a?(Decimal128)
-            {
-              builder: Decimal128ArrayBuilder.new,
-            }
-          else
+          builder_info ||= {}
+          if builder_info[:builder]
             {
-              builder: Decimal256ArrayBuilder.new,
+              builder: StringArrayBuilder.new,
               detected: true,
             }
+          else
+            precision = [builder_info[:precision] || 0, value.precision].max
+            scale = [builder_info[:scale] || 0, value.scale].max

Review Comment:
   I misreading the code.  It's OK now.  But, I guess we may need to permit to 
pass precision and scale to `Arrow::Array.new` as optional arguments 
like`Arrow::Array.new([BigDecimal("1.1"), BigDecimal("11.11")], scale: 1)`.



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