Class: ArrowFormat::Org::Apache::Arrow::Flatbuf::KeyValue

Inherits:
FlatBuffers::Table
  • Object
show all
Defined in:
lib/arrow-format/org/apache/arrow/flatbuf/key_value.rb

Overview


user defined key value pairs to add custom metadata to arrow key namespacing is the responsibility of the user

Constant Summary collapse

FIELDS =
{
  key: ::FlatBuffers::Field.new(:key, 0, 4, :string, 0),
  value: ::FlatBuffers::Field.new(:value, 1, 6, :string, 0),
}
Data =
define_data_class

Instance Method Summary collapse

Instance Method Details

#keyObject



25
26
27
28
29
30
# File 'lib/arrow-format/org/apache/arrow/flatbuf/key_value.rb', line 25

def key
  field_offset = @view.unpack_virtual_offset(4)
  return nil if field_offset.zero?

  @view.unpack_string(field_offset)
end

#valueObject



32
33
34
35
36
37
# File 'lib/arrow-format/org/apache/arrow/flatbuf/key_value.rb', line 32

def value
  field_offset = @view.unpack_virtual_offset(6)
  return nil if field_offset.zero?

  @view.unpack_string(field_offset)
end