Class: Parqueteur::Types::StructType

Inherits:
Parqueteur::Type show all
Defined in:
lib/parqueteur/types/struct_type.rb

Instance Attribute Summary

Attributes inherited from Parqueteur::Type

#arrow_type, #options

Instance Method Summary collapse

Methods inherited from Parqueteur::Type

#initialize, #resolve

Constructor Details

This class inherits a constructor from Parqueteur::Type

Instance Method Details

#arrow_type_builderObject



24
25
26
# File 'lib/parqueteur/types/struct_type.rb', line 24

def arrow_type_builder
  Arrow::StructDataType.new(struct_object.to_arrow_type)
end

#build_value_array(values) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/parqueteur/types/struct_type.rb', line 11

def build_value_array(values)
  values.each do |value|
    next if value.nil?

    value.each_key do |key|
      next if struct_object.key?(key)

      raise Parqueteur::Error, "Struct field '#{key}' not found"
    end
  end
  Arrow::StructArrayBuilder.build(arrow_type, values)
end