Class: Arrow::StructArray
- Defined in:
- lib/arrow/jruby/array.rb,
lib/arrow/struct-array.rb
Constant Summary
Constants inherited from Array
Array::VectorAppender, Array::VectorEqualsVisitor
Instance Attribute Summary
Attributes inherited from Array
Instance Method Summary collapse
- #fields ⇒ Object
- #fields_raw ⇒ Object
- #find_field(index_or_name) ⇒ Object
-
#get_value(i) ⇒ Hash
The ‘i`-th struct.
Methods inherited from Array
#+, #==, #[], builder_class, #cast, #close, #concatenate, #concatenate_raw, #each, #equal_array?, #initialize, #inspect, #is_in, #is_in_raw, #length, new, #null?, #resolve, #reverse_each, #size, #to_a, #to_arrow, #to_arrow_array, #to_arrow_chunked_array, #to_s, try_convert, #value_data_type, #value_data_type_raw, #values
Methods included from InputReferable
Methods included from GenericTakeable
Methods included from GenericFilterable
Methods included from ArrayComputable
Constructor Details
This class inherits a constructor from Arrow::Array
Instance Method Details
#fields ⇒ Object
105 106 107 |
# File 'lib/arrow/jruby/array.rb', line 105 def fields raise NotImplementedError end |
#fields_raw ⇒ Object
54 55 56 |
# File 'lib/arrow/struct-array.rb', line 54 def fields raise NotImplementedError end |
#find_field(index) ⇒ Arrow::Array? #find_field(name) ⇒ Arrow::Array?
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/arrow/struct-array.rb', line 43 def find_field(index_or_name) case index_or_name when String, Symbol name = index_or_name (@name_to_field ||= build_name_to_field)[name.to_s] else index = index_or_name fields[index] end end |
#get_value(i) ⇒ Hash
Returns The ‘i`-th struct.
26 27 28 29 30 31 32 |
# File 'lib/arrow/struct-array.rb', line 26 def get_value(i) value = {} value_data_type.fields.zip(fields) do |field, field_array| value[field.name] = field_array[i] end value end |