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


##########
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:
   Could you show the actual value for easy to debug?
   
   ```suggestion
               message = "value size must be #{byte_width}: #{value.inspect}"
   ```



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