Sha256: 0f4a560002f76ccdf4da3d28c14c431362ed0cd3bfe9ee36dbb15d6ec41d3ba2

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

class StructArrayTest < Test::Unit::TestCase
  test("#[]") do
    type = Arrow::StructDataType.new([
      Arrow::Field.new("field1", :boolean),
      Arrow::Field.new("field2", :uint64),
    ])
    builder = Arrow::StructArrayBuilder.new(type)
    builder.append
    builder.get_field_builder(0).append(true)
    builder.get_field_builder(1).append(1)
    builder.append
    builder.get_field_builder(0).append(false)
    builder.get_field_builder(1).append(2)
    array = builder.finish

    assert_equal([[true, false], [1, 2]],
                 [array[0].to_a, array[1].to_a])
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
red-arrow-0.11.0 test/test-struct-array.rb
red-arrow-0.10.0 test/test-struct-array.rb