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

Method setup

ruby/red-arrow/test/test-dense-union-array.rb:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18class DenseUnionArrayTest < Test::Unit::TestCase
19 def setup
20 data_type_fields = [
21 Arrow::Field.new("number", :int16),
22 Arrow::Field.new("text", :string),
23 ]
24 type_codes = [11, 13]
25 @data_type = Arrow::DenseUnionDataType.new(data_type_fields, type_codes)
26 type_ids = Arrow::Int8Array.new([11, 13, 11, 13, 13])
27 value_offsets = Arrow::Int32Array.new([0, 0, 1, 1, 2])
28 fields = [
29 Arrow::Int16Array.new([1, nil]),
30 Arrow::StringArray.new(["a", "b", "c"])
31 ]
32 @array = Arrow::DenseUnionArray.new(@data_type,
33 type_ids,
34 value_offsets,
35 fields)
36 end
37
38 def test_get_value
39 assert_equal([1, "a", nil, "b", "c"],

Callers

nothing calls this directly

Calls 1

newMethod · 0.45

Tested by

no test coverage detected