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

Method find_field

ruby/red-arrow/lib/arrow/struct-array.rb:43–52  ·  view source on GitHub ↗

@overload find_field(index) @param index [Integer] The index of the field to be found. @return [Arrow::Array, nil] The `index`-th field or `nil` for out of range. @overload find_field(name) @param index [String, Symbol] The name of the field to be found. @return [Arrow::Array, nil] The field that has `name` or `nil` for nonexistent name.

(index_or_name)

Source from the content-addressed store, hash-verified

41 # @return [Arrow::Array, nil]
42 # The field that has `name` or `nil` for nonexistent name.
43 def find_field(index_or_name)
44 case index_or_name
45 when String, Symbol
46 name = index_or_name
47 (@name_to_field ||= build_name_to_field)[name.to_s]
48 else
49 index = index_or_name
50 fields[index]
51 end
52 end
53
54 alias_method :fields_raw, :fields
55 def fields

Callers 2

StructArrayTestClass · 0.45

Calls 1

to_sMethod · 0.45

Tested by

no test coverage detected