Class: ArrowFormat::DayTimeIntervalArray

Inherits:
IntervalArray show all
Defined in:
lib/arrow-format/array.rb

Instance Attribute Summary

Attributes inherited from Array

#offset, #size, #type, #validity_buffer

Instance Method Summary collapse

Methods inherited from PrimitiveArray

#each_buffer, #initialize

Methods inherited from Array

#empty?, #initialize, #n_nulls, #null?, #slice, #valid?

Constructor Details

This class inherits a constructor from ArrowFormat::PrimitiveArray

Instance Method Details

#to_aObject



351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/arrow-format/array.rb', line 351

def to_a
  return [] if empty?

  offset = element_size * @offset
  values = @values_buffer.
             each(@type.buffer_type, offset, @size * 2).
             each_slice(2).
             collect do |(_, day), (_, time)|
    [day, time]
  end
  apply_validity(values)
end