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


##########
ruby/red-arrow-format/lib/arrow-format/array.rb:
##########
@@ -229,6 +229,32 @@ def encoding
     end
   end
 
+  class FixedSizeBinaryArray < Array
+    def initialize(type, size, validity_buffer, values_buffer)
+      super(type, size, validity_buffer)
+      @values_buffer = values_buffer
+    end
+
+    def to_a
+      byte_width = @type.byte_width
+      values = 0.step(@size * byte_width - 1, byte_width).collect do |offset|
+        @values_buffer.get_string(offset, byte_width)
+      end
+      apply_validity(values)
+    end
+  end
+
+  class BinaryArray < VariableSizeBinaryLayoutArray
+    private
+    def buffer_type
+      :s32 # TODO: big endian support
+    end
+
+    def encoding
+      Encoding::ASCII_8BIT
+    end
+  end
+

Review Comment:
   Oh, sorry for the garbage.



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