otegami commented on code in PR #50854:
URL: https://github.com/apache/arrow/pull/50854#discussion_r3774524476


##########
ruby/red-arrow-format/lib/arrow-format/array.rb:
##########
@@ -875,6 +889,44 @@ def to_a
       end
       apply_validity(values)
     end
+
+    private
+    def build_data(data, type)
+      n = 0
+      validity_buffer_builder = nil
+
+      values = +"".b
+      byte_width = type.byte_width
+      null_value = "\x00" * byte_width
+
+      data.each_with_index do |value, i|
+        if value.nil?
+          validity_buffer_builder ||= SparseBitmapBuilder.new
+          validity_buffer_builder.unset(i)
+          values.append_as_bytes(null_value)
+        else
+          unless value.bytesize == byte_width
+            message = "value size must be #{byte_width}: #{value.bytesize}"

Review Comment:
   fix: 
https://github.com/apache/arrow/pull/50854/changes#diff-94226bf2a6f57e453bae1425fc7d92410f15de7effc0bc83fefe8e2d3e87ca29R909
 Sure. Thank you for reviewing.



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