Class: Arrow::DenseUnionArrayBuilder

Inherits:
UnionArrayBuilder show all
Defined in:
lib/arrow/jruby/array-builder.rb,
lib/arrow/dense-union-array-builder.rb

Constant Summary

Constants included from ArrayBuildable

ArrayBuildable::ValueVector

Instance Method Summary collapse

Methods inherited from UnionArrayBuilder

#append_child, #append_child_raw, #append_values

Methods inherited from ArrayBuilder

#append, #append_nulls, #append_values, #build, build, buildable?, #finish, #initialize

Methods included from ArrayBuildable

#buildable?

Constructor Details

This class inherits a constructor from Arrow::ArrayBuilder

Instance Method Details

#append_valueObject #append_value(value) ⇒ Object

Overloads:

  • #append_valueObject

    Starts appending an union record. You need to append values of fields.

  • #append_value(value) ⇒ Object

    Appends an union record including values of fields.

    Parameters:

    • value (nil, Hash)

      The union record value.

      If this is ‘nil`, the union record is null.

      If this is ‘Hash`, it’s values of fields.

Since:

  • 12.0.0



38
39
40
41
42
43
44
45
46
47
# File 'lib/arrow/dense-union-array-builder.rb', line 38

def append_value(value)
  if value.nil?
    append_null
  else
    key = value.keys[0]
    child_info = child_infos[key]
    append_value_raw(child_info[:id])
    child_info[:builder].append(value.values[0])
  end
end

#append_value_rawObject



20
# File 'lib/arrow/dense-union-array-builder.rb', line 20

alias_method :append_value_raw, :append_value