MCPcopy Create free account
hub / github.com/apache/arrow / to_a

Method to_a

ruby/red-arrow-format/lib/arrow-format/array.rb:935–951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933
934 class DecimalArray < FixedSizeBinaryArray
935 def to_a
936 return [] if empty?
937
938 byte_width = @type.byte_width
939 buffer_types = [:u64] * (byte_width / 8 - 1) + [:s64]
940 base_offset = byte_width * @offset
941 values = 0.step(@size * byte_width - 1, byte_width).collect do |offset|
942 @values_buffer.get_values(buffer_types, base_offset + offset)
943 end
944 apply_validity(values).collect do |value|
945 if value.nil?
946 nil
947 else
948 BigDecimal(format_value(value))
949 end
950 end
951 end
952
953 private
954 def format_value(components)

Callers

nothing calls this directly

Calls 2

BigDecimalClass · 0.85
byte_widthMethod · 0.45

Tested by

no test coverage detected