kou commented on code in PR #48699:
URL: https://github.com/apache/arrow/pull/48699#discussion_r2656162122
##########
ruby/red-arrow/lib/arrow/array-builder.rb:
##########
@@ -186,6 +199,34 @@ def create_builder(builder_info)
data_type = Decimal256DataType.new(builder_info[:precision],
builder_info[:scale])
Decimal256ArrayBuilder.new(data_type)
+ when :int
+ required_bit_length = builder_info[:bit_length] + 1
Review Comment:
Or how about computing it from `min` and `max`?
```ruby
when :int
min = builder_info[:min]
max = builder_info[:max]
if GLib::MININT8 <= min and max <= GLib::MAXINT8
Int8ArrayBuilder.new
elsif GLib::MININT16 <= min and max <= GLib::MAXINT16
Int16ArrayBuilder.new
...
else
StringArrayBuilder.new
end
end
```
--
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]