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

Method build_schema

c_glib/test/helper/buildable.rb:20–35  ·  view source on GitHub ↗
(fields)

Source from the content-addressed store, hash-verified

18module Helper
19 module Buildable
20 def build_schema(fields)
21 fields = fields.collect do |name, data_type|
22 if data_type.is_a?(Symbol)
23 data_type_class_name =
24 data_type.
25 to_s.
26 split("_").
27 collect(&:capitalize).
28 join.
29 gsub(/\AUint/, "UInt") + "DataType"
30 data_type = Arrow.const_get(data_type_class_name).new
31 end
32 Arrow::Field.new(name, data_type)
33 end
34 Arrow::Schema.new(fields)
35 end
36
37 def build_null_array(values)
38 build_array(Arrow::NullArrayBuilder.new, values)

Callers

nothing calls this directly

Calls 3

joinMethod · 0.45
to_sMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected