red-arrow 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/arrow/converters.hpp +15 -2
- data/ext/arrow/raw-records.cpp +1 -0
- data/ext/arrow/values.cpp +1 -0
- data/lib/arrow/array-builder.rb +11 -6
- data/lib/arrow/bigdecimal-extension.rb +5 -1
- data/lib/arrow/decimal128-array-builder.rb +21 -25
- data/lib/arrow/decimal128-data-type.rb +2 -0
- data/lib/arrow/decimal128.rb +18 -0
- data/lib/arrow/decimal256-array-builder.rb +61 -0
- data/lib/arrow/decimal256-array.rb +25 -0
- data/lib/arrow/decimal256-data-type.rb +73 -0
- data/lib/arrow/decimal256.rb +60 -0
- data/lib/arrow/fixed-size-binary-array-builder.rb +38 -0
- data/lib/arrow/fixed-size-binary-array.rb +26 -0
- data/lib/arrow/loader.rb +13 -0
- data/lib/arrow/version.rb +1 -1
- data/red-arrow.gemspec +1 -0
- data/test/raw-records/test-basic-arrays.rb +17 -0
- data/test/raw-records/test-dense-union-array.rb +14 -0
- data/test/raw-records/test-list-array.rb +20 -0
- data/test/raw-records/test-sparse-union-array.rb +14 -0
- data/test/raw-records/test-struct-array.rb +15 -0
- data/test/test-array.rb +2 -2
- data/test/test-bigdecimal.rb +20 -3
- data/test/test-decimal128-array-builder.rb +18 -1
- data/test/test-decimal128.rb +38 -0
- data/test/test-decimal256-array-builder.rb +112 -0
- data/test/test-decimal256-array.rb +38 -0
- data/test/test-decimal256-data-type.rb +31 -0
- data/test/test-decimal256.rb +102 -0
- data/test/test-fixed-size-binary-array-builder.rb +92 -0
- data/test/test-fixed-size-binary-array.rb +36 -0
- data/test/test-struct-array-builder.rb +8 -8
- data/test/test-struct-array.rb +2 -2
- data/test/values/test-basic-arrays.rb +11 -0
- data/test/values/test-dense-union-array.rb +14 -0
- data/test/values/test-list-array.rb +18 -0
- data/test/values/test-sparse-union-array.rb +14 -0
- data/test/values/test-struct-array.rb +15 -0
- metadata +93 -61
| @@ -0,0 +1,31 @@ | |
| 1 | 
            +
            # Licensed to the Apache Software Foundation (ASF) under one
         | 
| 2 | 
            +
            # or more contributor license agreements.  See the NOTICE file
         | 
| 3 | 
            +
            # distributed with this work for additional information
         | 
| 4 | 
            +
            # regarding copyright ownership.  The ASF licenses this file
         | 
| 5 | 
            +
            # to you under the Apache License, Version 2.0 (the
         | 
| 6 | 
            +
            # "License"); you may not use this file except in compliance
         | 
| 7 | 
            +
            # with the License.  You may obtain a copy of the License at
         | 
| 8 | 
            +
            #
         | 
| 9 | 
            +
            #   http://www.apache.org/licenses/LICENSE-2.0
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # Unless required by applicable law or agreed to in writing,
         | 
| 12 | 
            +
            # software distributed under the License is distributed on an
         | 
| 13 | 
            +
            # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
         | 
| 14 | 
            +
            # KIND, either express or implied.  See the License for the
         | 
| 15 | 
            +
            # specific language governing permissions and limitations
         | 
| 16 | 
            +
            # under the License.
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            class Decimal256DataTypeTest < Test::Unit::TestCase
         | 
| 19 | 
            +
              sub_test_case(".new") do
         | 
| 20 | 
            +
                test("ordered arguments") do
         | 
| 21 | 
            +
                  assert_equal("decimal256(8, 2)",
         | 
| 22 | 
            +
                               Arrow::Decimal256DataType.new(8, 2).to_s)
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                test("description") do
         | 
| 26 | 
            +
                  assert_equal("decimal256(8, 2)",
         | 
| 27 | 
            +
                               Arrow::Decimal256DataType.new(precision: 8,
         | 
| 28 | 
            +
                                                             scale: 2).to_s)
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
            end
         | 
| @@ -0,0 +1,102 @@ | |
| 1 | 
            +
            # Licensed to the Apache Software Foundation (ASF) under one
         | 
| 2 | 
            +
            # or more contributor license agreements.  See the NOTICE file
         | 
| 3 | 
            +
            # distributed with this work for additional information
         | 
| 4 | 
            +
            # regarding copyright ownership.  The ASF licenses this file
         | 
| 5 | 
            +
            # to you under the Apache License, Version 2.0 (the
         | 
| 6 | 
            +
            # "License"); you may not use this file except in compliance
         | 
| 7 | 
            +
            # with the License.  You may obtain a copy of the License at
         | 
| 8 | 
            +
            #
         | 
| 9 | 
            +
            #   http://www.apache.org/licenses/LICENSE-2.0
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # Unless required by applicable law or agreed to in writing,
         | 
| 12 | 
            +
            # software distributed under the License is distributed on an
         | 
| 13 | 
            +
            # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
         | 
| 14 | 
            +
            # KIND, either express or implied.  See the License for the
         | 
| 15 | 
            +
            # specific language governing permissions and limitations
         | 
| 16 | 
            +
            # under the License.
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            class Decimal256Test < Test::Unit::TestCase
         | 
| 19 | 
            +
              sub_test_case("instance methods") do
         | 
| 20 | 
            +
                def setup
         | 
| 21 | 
            +
                  @decimal256 = Arrow::Decimal256.new("10.1")
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                sub_test_case("#==") do
         | 
| 25 | 
            +
                  test("Arrow::Decimal256") do
         | 
| 26 | 
            +
                    assert do
         | 
| 27 | 
            +
                      @decimal256 == @decimal256
         | 
| 28 | 
            +
                    end
         | 
| 29 | 
            +
                  end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                  test("not Arrow::Decimal256") do
         | 
| 32 | 
            +
                    assert do
         | 
| 33 | 
            +
                      not (@decimal256 == 10.1)
         | 
| 34 | 
            +
                    end
         | 
| 35 | 
            +
                  end
         | 
| 36 | 
            +
                end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                sub_test_case("#!=") do
         | 
| 39 | 
            +
                  test("Arrow::Decimal256") do
         | 
| 40 | 
            +
                    assert do
         | 
| 41 | 
            +
                      not (@decimal256 != @decimal256)
         | 
| 42 | 
            +
                    end
         | 
| 43 | 
            +
                  end
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                  test("not Arrow::Decimal256") do
         | 
| 46 | 
            +
                    assert do
         | 
| 47 | 
            +
                      @decimal256 != 10.1
         | 
| 48 | 
            +
                    end
         | 
| 49 | 
            +
                  end
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                sub_test_case("#to_s") do
         | 
| 53 | 
            +
                  test("default") do
         | 
| 54 | 
            +
                    assert_equal("101",
         | 
| 55 | 
            +
                                 @decimal256.to_s)
         | 
| 56 | 
            +
                  end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                  test("scale") do
         | 
| 59 | 
            +
                    assert_equal("10.1",
         | 
| 60 | 
            +
                                 @decimal256.to_s(1))
         | 
| 61 | 
            +
                  end
         | 
| 62 | 
            +
                end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                test("#abs") do
         | 
| 65 | 
            +
                  decimal256 = Arrow::Decimal256.new("-10.1")
         | 
| 66 | 
            +
                  assert_equal([
         | 
| 67 | 
            +
                                 Arrow::Decimal256.new("-10.1"),
         | 
| 68 | 
            +
                                 Arrow::Decimal256.new("10.1"),
         | 
| 69 | 
            +
                               ],
         | 
| 70 | 
            +
                               [
         | 
| 71 | 
            +
                                 decimal256,
         | 
| 72 | 
            +
                                 decimal256.abs,
         | 
| 73 | 
            +
                               ])
         | 
| 74 | 
            +
                end
         | 
| 75 | 
            +
             | 
| 76 | 
            +
                test("#abs!") do
         | 
| 77 | 
            +
                  decimal256 = Arrow::Decimal256.new("-10.1")
         | 
| 78 | 
            +
                  decimal256.abs!
         | 
| 79 | 
            +
                  assert_equal(Arrow::Decimal256.new("10.1"),
         | 
| 80 | 
            +
                               decimal256)
         | 
| 81 | 
            +
                end
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                test("#negate") do
         | 
| 84 | 
            +
                  decimal256 = Arrow::Decimal256.new("-10.1")
         | 
| 85 | 
            +
                  assert_equal([
         | 
| 86 | 
            +
                                 Arrow::Decimal256.new("-10.1"),
         | 
| 87 | 
            +
                                 Arrow::Decimal256.new("10.1"),
         | 
| 88 | 
            +
                               ],
         | 
| 89 | 
            +
                               [
         | 
| 90 | 
            +
                                 decimal256,
         | 
| 91 | 
            +
                                 decimal256.negate,
         | 
| 92 | 
            +
                               ])
         | 
| 93 | 
            +
                end
         | 
| 94 | 
            +
             | 
| 95 | 
            +
                test("#negate!") do
         | 
| 96 | 
            +
                  decimal256 = Arrow::Decimal256.new("-10.1")
         | 
| 97 | 
            +
                  decimal256.negate!
         | 
| 98 | 
            +
                  assert_equal(Arrow::Decimal256.new("10.1"),
         | 
| 99 | 
            +
                               decimal256)
         | 
| 100 | 
            +
                end
         | 
| 101 | 
            +
              end
         | 
| 102 | 
            +
            end
         | 
| @@ -0,0 +1,92 @@ | |
| 1 | 
            +
            # Licensed to the Apache Software Foundation (ASF) under one
         | 
| 2 | 
            +
            # or more contributor license agreements.  See the NOTICE file
         | 
| 3 | 
            +
            # distributed with this work for additional information
         | 
| 4 | 
            +
            # regarding copyright ownership.  The ASF licenses this file
         | 
| 5 | 
            +
            # to you under the Apache License, Version 2.0 (the
         | 
| 6 | 
            +
            # "License"); you may not use this file except in compliance
         | 
| 7 | 
            +
            # with the License.  You may obtain a copy of the License at
         | 
| 8 | 
            +
            #
         | 
| 9 | 
            +
            #   http://www.apache.org/licenses/LICENSE-2.0
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # Unless required by applicable law or agreed to in writing,
         | 
| 12 | 
            +
            # software distributed under the License is distributed on an
         | 
| 13 | 
            +
            # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
         | 
| 14 | 
            +
            # KIND, either express or implied.  See the License for the
         | 
| 15 | 
            +
            # specific language governing permissions and limitations
         | 
| 16 | 
            +
            # under the License.
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            class FixedSizeBinaryArrayBuilderTest < Test::Unit::TestCase
         | 
| 19 | 
            +
              def setup
         | 
| 20 | 
            +
                @data_type = Arrow::FixedSizeBinaryDataType.new(4)
         | 
| 21 | 
            +
                @builder = Arrow::FixedSizeBinaryArrayBuilder.new(@data_type)
         | 
| 22 | 
            +
              end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              sub_test_case("#append_value") do
         | 
| 25 | 
            +
                test("nil") do
         | 
| 26 | 
            +
                  @builder.append_value(nil)
         | 
| 27 | 
            +
                  array = @builder.finish
         | 
| 28 | 
            +
                  assert_equal(nil, array[0])
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                test("String") do
         | 
| 32 | 
            +
                  @builder.append_value("0123")
         | 
| 33 | 
            +
                  array = @builder.finish
         | 
| 34 | 
            +
                  assert_equal("0123", array[0])
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                test("GLib::Bytes") do
         | 
| 38 | 
            +
                  @builder.append_value(GLib::Bytes.new("0123"))
         | 
| 39 | 
            +
                  array = @builder.finish
         | 
| 40 | 
            +
                  assert_equal("0123", array[0])
         | 
| 41 | 
            +
                end
         | 
| 42 | 
            +
              end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
              sub_test_case("#append_values") do
         | 
| 45 | 
            +
                test("mixed") do
         | 
| 46 | 
            +
                  @builder.append_values([
         | 
| 47 | 
            +
                                           "0123",
         | 
| 48 | 
            +
                                           nil,
         | 
| 49 | 
            +
                                           GLib::Bytes.new("abcd"),
         | 
| 50 | 
            +
                                         ])
         | 
| 51 | 
            +
                  array = @builder.finish
         | 
| 52 | 
            +
                  assert_equal([
         | 
| 53 | 
            +
                                 "0123",
         | 
| 54 | 
            +
                                 nil,
         | 
| 55 | 
            +
                                 "abcd",
         | 
| 56 | 
            +
                               ],
         | 
| 57 | 
            +
                               array.to_a)
         | 
| 58 | 
            +
                end
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                test("is_valids") do
         | 
| 61 | 
            +
                  @builder.append_values([
         | 
| 62 | 
            +
                                           "0123",
         | 
| 63 | 
            +
                                           "0123",
         | 
| 64 | 
            +
                                           "0123",
         | 
| 65 | 
            +
                                         ],
         | 
| 66 | 
            +
                                         [
         | 
| 67 | 
            +
                                           true,
         | 
| 68 | 
            +
                                           false,
         | 
| 69 | 
            +
                                           true,
         | 
| 70 | 
            +
                                         ])
         | 
| 71 | 
            +
                  array = @builder.finish
         | 
| 72 | 
            +
                  assert_equal([
         | 
| 73 | 
            +
                                 "0123",
         | 
| 74 | 
            +
                                 nil,
         | 
| 75 | 
            +
                                 "0123",
         | 
| 76 | 
            +
                               ],
         | 
| 77 | 
            +
                               array.to_a)
         | 
| 78 | 
            +
                end
         | 
| 79 | 
            +
             | 
| 80 | 
            +
                test("packed") do
         | 
| 81 | 
            +
                  @builder.append_values("0123" * 3,
         | 
| 82 | 
            +
                                         [true, false, true])
         | 
| 83 | 
            +
                  array = @builder.finish
         | 
| 84 | 
            +
                  assert_equal([
         | 
| 85 | 
            +
                                 "0123",
         | 
| 86 | 
            +
                                 nil,
         | 
| 87 | 
            +
                                 "0123",
         | 
| 88 | 
            +
                               ],
         | 
| 89 | 
            +
                               array.to_a)
         | 
| 90 | 
            +
                end
         | 
| 91 | 
            +
              end
         | 
| 92 | 
            +
            end
         | 
| @@ -0,0 +1,36 @@ | |
| 1 | 
            +
            # Licensed to the Apache Software Foundation (ASF) under one
         | 
| 2 | 
            +
            # or more contributor license agreements.  See the NOTICE file
         | 
| 3 | 
            +
            # distributed with this work for additional information
         | 
| 4 | 
            +
            # regarding copyright ownership.  The ASF licenses this file
         | 
| 5 | 
            +
            # to you under the Apache License, Version 2.0 (the
         | 
| 6 | 
            +
            # "License"); you may not use this file except in compliance
         | 
| 7 | 
            +
            # with the License.  You may obtain a copy of the License at
         | 
| 8 | 
            +
            #
         | 
| 9 | 
            +
            #   http://www.apache.org/licenses/LICENSE-2.0
         | 
| 10 | 
            +
            #
         | 
| 11 | 
            +
            # Unless required by applicable law or agreed to in writing,
         | 
| 12 | 
            +
            # software distributed under the License is distributed on an
         | 
| 13 | 
            +
            # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
         | 
| 14 | 
            +
            # KIND, either express or implied.  See the License for the
         | 
| 15 | 
            +
            # specific language governing permissions and limitations
         | 
| 16 | 
            +
            # under the License.
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            class FixedSizeBinaryArrayTest < Test::Unit::TestCase
         | 
| 19 | 
            +
              sub_test_case(".new") do
         | 
| 20 | 
            +
                test("build") do
         | 
| 21 | 
            +
                  data_type = Arrow::FixedSizeBinaryDataType.new(4)
         | 
| 22 | 
            +
                  values = [
         | 
| 23 | 
            +
                    "0123",
         | 
| 24 | 
            +
                    nil,
         | 
| 25 | 
            +
                    GLib::Bytes.new("abcd"),
         | 
| 26 | 
            +
                  ]
         | 
| 27 | 
            +
                  array = Arrow::FixedSizeBinaryArray.new(data_type, values)
         | 
| 28 | 
            +
                  assert_equal([
         | 
| 29 | 
            +
                                 "0123",
         | 
| 30 | 
            +
                                 nil,
         | 
| 31 | 
            +
                                 "abcd",
         | 
| 32 | 
            +
                               ],
         | 
| 33 | 
            +
                               array.to_a)
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
            end
         | 
| @@ -27,8 +27,8 @@ class StructArrayBuilderTest < Test::Unit::TestCase | |
| 27 27 | 
             
                  @builder.append_value(nil)
         | 
| 28 28 | 
             
                  array = @builder.finish
         | 
| 29 29 | 
             
                  assert_equal([
         | 
| 30 | 
            -
                                 [ | 
| 31 | 
            -
                                 [ | 
| 30 | 
            +
                                 [false],
         | 
| 31 | 
            +
                                 [0],
         | 
| 32 32 | 
             
                               ],
         | 
| 33 33 | 
             
                               [
         | 
| 34 34 | 
             
                                 array.find_field(0).to_a,
         | 
| @@ -87,8 +87,8 @@ class StructArrayBuilderTest < Test::Unit::TestCase | |
| 87 87 | 
             
                  @builder.append_values([nil])
         | 
| 88 88 | 
             
                  array = @builder.finish
         | 
| 89 89 | 
             
                  assert_equal([
         | 
| 90 | 
            -
                                 [ | 
| 91 | 
            -
                                 [ | 
| 90 | 
            +
                                 [false],
         | 
| 91 | 
            +
                                 [0],
         | 
| 92 92 | 
             
                               ],
         | 
| 93 93 | 
             
                               [
         | 
| 94 94 | 
             
                                 array.find_field(0).to_a,
         | 
| @@ -130,8 +130,8 @@ class StructArrayBuilderTest < Test::Unit::TestCase | |
| 130 130 | 
             
                                         ])
         | 
| 131 131 | 
             
                  array = @builder.finish
         | 
| 132 132 | 
             
                  assert_equal([
         | 
| 133 | 
            -
                                 [ | 
| 134 | 
            -
                                 [ | 
| 133 | 
            +
                                 [false, true, false],
         | 
| 134 | 
            +
                                 [0, 1, 2],
         | 
| 135 135 | 
             
                               ],
         | 
| 136 136 | 
             
                               [
         | 
| 137 137 | 
             
                                 array.find_field(0).to_a,
         | 
| @@ -152,8 +152,8 @@ class StructArrayBuilderTest < Test::Unit::TestCase | |
| 152 152 | 
             
                                         ])
         | 
| 153 153 | 
             
                  array = @builder.finish
         | 
| 154 154 | 
             
                  assert_equal([
         | 
| 155 | 
            -
                                 [true,  | 
| 156 | 
            -
                                 [1,  | 
| 155 | 
            +
                                 [true, false, true],
         | 
| 156 | 
            +
                                 [1, 0, 3],
         | 
| 157 157 | 
             
                               ],
         | 
| 158 158 | 
             
                               [
         | 
| 159 159 | 
             
                                 array.find_field(0).to_a,
         | 
    
        data/test/test-struct-array.rb
    CHANGED
    
    
| @@ -265,6 +265,17 @@ module ValuesBasicArraysTests | |
| 265 265 | 
             
                target = build(Arrow::Decimal128Array.new(data_type, values))
         | 
| 266 266 | 
             
                assert_equal(values, target.values)
         | 
| 267 267 | 
             
              end
         | 
| 268 | 
            +
             | 
| 269 | 
            +
              def test_decimal256
         | 
| 270 | 
            +
                values = [
         | 
| 271 | 
            +
                  BigDecimal("92.92"),
         | 
| 272 | 
            +
                  nil,
         | 
| 273 | 
            +
                  BigDecimal("29.29"),
         | 
| 274 | 
            +
                ]
         | 
| 275 | 
            +
                data_type = Arrow::Decimal256DataType.new(38, 2)
         | 
| 276 | 
            +
                target = build(Arrow::Decimal256Array.new(data_type, values))
         | 
| 277 | 
            +
                assert_equal(values, target.values)
         | 
| 278 | 
            +
              end
         | 
| 268 279 | 
             
            end
         | 
| 269 280 |  | 
| 270 281 | 
             
            class ValuesArrayBasicArraysTest < Test::Unit::TestCase
         | 
| @@ -333,6 +333,20 @@ module ValuesDenseUnionArrayTests | |
| 333 333 | 
             
                assert_equal(values, target.values)
         | 
| 334 334 | 
             
              end
         | 
| 335 335 |  | 
| 336 | 
            +
              def test_decimal256
         | 
| 337 | 
            +
                values = [
         | 
| 338 | 
            +
                  {"0" => BigDecimal("92.92")},
         | 
| 339 | 
            +
                  {"1" => nil},
         | 
| 340 | 
            +
                ]
         | 
| 341 | 
            +
                target = build({
         | 
| 342 | 
            +
                                 type: :decimal256,
         | 
| 343 | 
            +
                                 precision: 38,
         | 
| 344 | 
            +
                                 scale: 2,
         | 
| 345 | 
            +
                               },
         | 
| 346 | 
            +
                               values)
         | 
| 347 | 
            +
                assert_equal(values, target.values)
         | 
| 348 | 
            +
              end
         | 
| 349 | 
            +
             | 
| 336 350 | 
             
              def test_list
         | 
| 337 351 | 
             
                values = [
         | 
| 338 352 | 
             
                  {"0" => [true, nil, false]},
         | 
| @@ -354,6 +354,24 @@ module ValuesListArrayTests | |
| 354 354 | 
             
                assert_equal(values, target.values)
         | 
| 355 355 | 
             
              end
         | 
| 356 356 |  | 
| 357 | 
            +
              def test_decimal256
         | 
| 358 | 
            +
                values = [
         | 
| 359 | 
            +
                  [
         | 
| 360 | 
            +
                    BigDecimal("92.92"),
         | 
| 361 | 
            +
                    nil,
         | 
| 362 | 
            +
                    BigDecimal("29.29"),
         | 
| 363 | 
            +
                  ],
         | 
| 364 | 
            +
                  nil,
         | 
| 365 | 
            +
                ]
         | 
| 366 | 
            +
                target = build({
         | 
| 367 | 
            +
                                 type: :decimal256,
         | 
| 368 | 
            +
                                 precision: 38,
         | 
| 369 | 
            +
                                 scale: 2,
         | 
| 370 | 
            +
                               },
         | 
| 371 | 
            +
                               values)
         | 
| 372 | 
            +
                assert_equal(values, target.values)
         | 
| 373 | 
            +
              end
         | 
| 374 | 
            +
             | 
| 357 375 | 
             
              def test_list
         | 
| 358 376 | 
             
                values = [
         | 
| 359 377 | 
             
                  [
         | 
| @@ -324,6 +324,20 @@ module ValuesSparseUnionArrayTests | |
| 324 324 | 
             
                assert_equal(values, target.values)
         | 
| 325 325 | 
             
              end
         | 
| 326 326 |  | 
| 327 | 
            +
              def test_decimal256
         | 
| 328 | 
            +
                values = [
         | 
| 329 | 
            +
                  {"0" => BigDecimal("92.92")},
         | 
| 330 | 
            +
                  {"1" => nil},
         | 
| 331 | 
            +
                ]
         | 
| 332 | 
            +
                target = build({
         | 
| 333 | 
            +
                                 type: :decimal256,
         | 
| 334 | 
            +
                                 precision: 38,
         | 
| 335 | 
            +
                                 scale: 2,
         | 
| 336 | 
            +
                               },
         | 
| 337 | 
            +
                               values)
         | 
| 338 | 
            +
                assert_equal(values, target.values)
         | 
| 339 | 
            +
              end
         | 
| 340 | 
            +
             | 
| 327 341 | 
             
              def test_list
         | 
| 328 342 | 
             
                values = [
         | 
| 329 343 | 
             
                  {"0" => [true, nil, false]},
         | 
| @@ -326,6 +326,21 @@ module ValuesStructArrayTests | |
| 326 326 | 
             
                assert_equal(values, target.values)
         | 
| 327 327 | 
             
              end
         | 
| 328 328 |  | 
| 329 | 
            +
              def test_decimal256
         | 
| 330 | 
            +
                values = [
         | 
| 331 | 
            +
                  {"field" => BigDecimal("92.92")},
         | 
| 332 | 
            +
                  nil,
         | 
| 333 | 
            +
                  {"field" => nil},
         | 
| 334 | 
            +
                ]
         | 
| 335 | 
            +
                target = build({
         | 
| 336 | 
            +
                                 type: :decimal256,
         | 
| 337 | 
            +
                                 precision: 38,
         | 
| 338 | 
            +
                                 scale: 2,
         | 
| 339 | 
            +
                               },
         | 
| 340 | 
            +
                               values)
         | 
| 341 | 
            +
                assert_equal(values, target.values)
         | 
| 342 | 
            +
              end
         | 
| 343 | 
            +
             | 
| 329 344 | 
             
              def test_list
         | 
| 330 345 | 
             
                values = [
         | 
| 331 346 | 
             
                  {"field" => [true, nil, false]},
         | 
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,29 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: red-arrow
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 3.0.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Apache Arrow Developers
         | 
| 8 | 
            -
            autorequire:
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2021-01-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: bigdecimal
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - ">="
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: 2.0.3
         | 
| 20 | 
            +
              type: :runtime
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - ">="
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: 2.0.3
         | 
| 13 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 28 | 
             
              name: extpp
         | 
| 15 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -208,12 +222,18 @@ files: | |
| 208 222 | 
             
            - lib/arrow/decimal128-array.rb
         | 
| 209 223 | 
             
            - lib/arrow/decimal128-data-type.rb
         | 
| 210 224 | 
             
            - lib/arrow/decimal128.rb
         | 
| 225 | 
            +
            - lib/arrow/decimal256-array-builder.rb
         | 
| 226 | 
            +
            - lib/arrow/decimal256-array.rb
         | 
| 227 | 
            +
            - lib/arrow/decimal256-data-type.rb
         | 
| 228 | 
            +
            - lib/arrow/decimal256.rb
         | 
| 211 229 | 
             
            - lib/arrow/dense-union-data-type.rb
         | 
| 212 230 | 
             
            - lib/arrow/dictionary-array.rb
         | 
| 213 231 | 
             
            - lib/arrow/dictionary-data-type.rb
         | 
| 214 232 | 
             
            - lib/arrow/field-containable.rb
         | 
| 215 233 | 
             
            - lib/arrow/field.rb
         | 
| 216 234 | 
             
            - lib/arrow/file-output-stream.rb
         | 
| 235 | 
            +
            - lib/arrow/fixed-size-binary-array-builder.rb
         | 
| 236 | 
            +
            - lib/arrow/fixed-size-binary-array.rb
         | 
| 217 237 | 
             
            - lib/arrow/generic-filterable.rb
         | 
| 218 238 | 
             
            - lib/arrow/generic-takeable.rb
         | 
| 219 239 | 
             
            - lib/arrow/group.rb
         | 
| @@ -292,12 +312,18 @@ files: | |
| 292 312 | 
             
            - test/test-decimal128-array.rb
         | 
| 293 313 | 
             
            - test/test-decimal128-data-type.rb
         | 
| 294 314 | 
             
            - test/test-decimal128.rb
         | 
| 315 | 
            +
            - test/test-decimal256-array-builder.rb
         | 
| 316 | 
            +
            - test/test-decimal256-array.rb
         | 
| 317 | 
            +
            - test/test-decimal256-data-type.rb
         | 
| 318 | 
            +
            - test/test-decimal256.rb
         | 
| 295 319 | 
             
            - test/test-dense-union-data-type.rb
         | 
| 296 320 | 
             
            - test/test-dictionary-array.rb
         | 
| 297 321 | 
             
            - test/test-dictionary-data-type.rb
         | 
| 298 322 | 
             
            - test/test-feather.rb
         | 
| 299 323 | 
             
            - test/test-field.rb
         | 
| 300 324 | 
             
            - test/test-file-output-stream.rb
         | 
| 325 | 
            +
            - test/test-fixed-size-binary-array-builder.rb
         | 
| 326 | 
            +
            - test/test-fixed-size-binary-array.rb
         | 
| 301 327 | 
             
            - test/test-group.rb
         | 
| 302 328 | 
             
            - test/test-list-array-builder.rb
         | 
| 303 329 | 
             
            - test/test-list-array.rb
         | 
| @@ -333,8 +359,8 @@ homepage: https://arrow.apache.org/ | |
| 333 359 | 
             
            licenses:
         | 
| 334 360 | 
             
            - Apache-2.0
         | 
| 335 361 | 
             
            metadata:
         | 
| 336 | 
            -
              msys2_mingw_dependencies: arrow>= | 
| 337 | 
            -
            post_install_message:
         | 
| 362 | 
            +
              msys2_mingw_dependencies: arrow>=3.0.0
         | 
| 363 | 
            +
            post_install_message: 
         | 
| 338 364 | 
             
            rdoc_options: []
         | 
| 339 365 | 
             
            require_paths:
         | 
| 340 366 | 
             
            - lib
         | 
| @@ -349,79 +375,85 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 349 375 | 
             
                - !ruby/object:Gem::Version
         | 
| 350 376 | 
             
                  version: '0'
         | 
| 351 377 | 
             
            requirements: []
         | 
| 352 | 
            -
            rubygems_version: 3. | 
| 353 | 
            -
            signing_key:
         | 
| 378 | 
            +
            rubygems_version: 3.2.5
         | 
| 379 | 
            +
            signing_key: 
         | 
| 354 380 | 
             
            specification_version: 4
         | 
| 355 381 | 
             
            summary: Red Arrow is the Ruby bindings of Apache Arrow
         | 
| 356 382 | 
             
            test_files:
         | 
| 357 | 
            -
            - test/test- | 
| 358 | 
            -
            - test/test- | 
| 383 | 
            +
            - test/test-decimal256-array-builder.rb
         | 
| 384 | 
            +
            - test/test-time64-data-type.rb
         | 
| 385 | 
            +
            - test/test-feather.rb
         | 
| 386 | 
            +
            - test/test-decimal128.rb
         | 
| 387 | 
            +
            - test/test-struct-array.rb
         | 
| 388 | 
            +
            - test/test-data-type.rb
         | 
| 389 | 
            +
            - test/test-list-data-type.rb
         | 
| 359 390 | 
             
            - test/test-dense-union-data-type.rb
         | 
| 360 | 
            -
            - test/test- | 
| 391 | 
            +
            - test/test-decimal256-array.rb
         | 
| 392 | 
            +
            - test/helper.rb
         | 
| 361 393 | 
             
            - test/test-record-batch.rb
         | 
| 362 | 
            -
            - test/test-list-data-type.rb
         | 
| 363 | 
            -
            - test/test-decimal128.rb
         | 
| 364 | 
            -
            - test/test-chunked-array.rb
         | 
| 365 | 
            -
            - test/test-array.rb
         | 
| 366 | 
            -
            - test/test-null-array.rb
         | 
| 367 | 
            -
            - test/test-struct-array-builder.rb
         | 
| 368 394 | 
             
            - test/test-table.rb
         | 
| 395 | 
            +
            - test/run-test.rb
         | 
| 396 | 
            +
            - test/test-timestamp-array.rb
         | 
| 397 | 
            +
            - test/test-date32-array.rb
         | 
| 398 | 
            +
            - test/test-array-builder.rb
         | 
| 399 | 
            +
            - test/test-date64-array.rb
         | 
| 400 | 
            +
            - test/test-record-batch-file-reader.rb
         | 
| 369 401 | 
             
            - test/test-decimal128-data-type.rb
         | 
| 370 | 
            -
            - test/ | 
| 402 | 
            +
            - test/test-time.rb
         | 
| 403 | 
            +
            - test/test-timestamp-data-type.rb
         | 
| 404 | 
            +
            - test/test-decimal256.rb
         | 
| 405 | 
            +
            - test/test-dictionary-array.rb
         | 
| 406 | 
            +
            - test/test-fixed-size-binary-array-builder.rb
         | 
| 407 | 
            +
            - test/test-column.rb
         | 
| 408 | 
            +
            - test/test-field.rb
         | 
| 409 | 
            +
            - test/test-decimal128-array.rb
         | 
| 410 | 
            +
            - test/test-csv-loader.rb
         | 
| 411 | 
            +
            - test/test-bigdecimal.rb
         | 
| 412 | 
            +
            - test/test-fixed-size-binary-array.rb
         | 
| 413 | 
            +
            - test/test-list-array.rb
         | 
| 414 | 
            +
            - test/test-decimal256-data-type.rb
         | 
| 415 | 
            +
            - test/test-time64-array.rb
         | 
| 416 | 
            +
            - test/test-rolling-window.rb
         | 
| 417 | 
            +
            - test/test-dictionary-data-type.rb
         | 
| 371 418 | 
             
            - test/fixture/integer-float.csv
         | 
| 372 | 
            -
            - test/fixture/null-with-double-quote.csv
         | 
| 373 | 
            -
            - test/fixture/with-header.csv
         | 
| 374 | 
            -
            - test/fixture/without-header.csv
         | 
| 375 419 | 
             
            - test/fixture/without-header-float.csv
         | 
| 420 | 
            +
            - test/fixture/null-with-double-quote.csv
         | 
| 376 421 | 
             
            - test/fixture/with-header-float.csv
         | 
| 422 | 
            +
            - test/fixture/TestOrcFile.test1.orc
         | 
| 377 423 | 
             
            - test/fixture/null-without-double-quote.csv
         | 
| 424 | 
            +
            - test/fixture/without-header.csv
         | 
| 425 | 
            +
            - test/fixture/with-header.csv
         | 
| 378 426 | 
             
            - test/fixture/float-integer.csv
         | 
| 379 | 
            -
            - test/ | 
| 427 | 
            +
            - test/test-orc.rb
         | 
| 428 | 
            +
            - test/test-null-array.rb
         | 
| 429 | 
            +
            - test/test-time32-data-type.rb
         | 
| 430 | 
            +
            - test/test-struct-data-type.rb
         | 
| 380 431 | 
             
            - test/test-group.rb
         | 
| 381 | 
            -
            - test/ | 
| 382 | 
            -
            - test/test- | 
| 383 | 
            -
            - test/test-csv-loader.rb
         | 
| 384 | 
            -
            - test/test-feather.rb
         | 
| 385 | 
            -
            - test/test-time64-data-type.rb
         | 
| 386 | 
            -
            - test/values/test-sparse-union-array.rb
         | 
| 432 | 
            +
            - test/test-buffer.rb
         | 
| 433 | 
            +
            - test/values/test-struct-array.rb
         | 
| 387 434 | 
             
            - test/values/test-basic-arrays.rb
         | 
| 388 | 
            -
            - test/values/test-dense-union-array.rb
         | 
| 389 435 | 
             
            - test/values/test-list-array.rb
         | 
| 390 | 
            -
            - test/values/test- | 
| 391 | 
            -
            - test/test- | 
| 392 | 
            -
            - test/test- | 
| 393 | 
            -
            - test/ | 
| 394 | 
            -
            - test/ | 
| 395 | 
            -
            - test/ | 
| 436 | 
            +
            - test/values/test-dense-union-array.rb
         | 
| 437 | 
            +
            - test/values/test-sparse-union-array.rb
         | 
| 438 | 
            +
            - test/test-slicer.rb
         | 
| 439 | 
            +
            - test/test-list-array-builder.rb
         | 
| 440 | 
            +
            - test/test-sparse-union-data-type.rb
         | 
| 441 | 
            +
            - test/test-record-batch-builder.rb
         | 
| 442 | 
            +
            - test/raw-records/test-struct-array.rb
         | 
| 396 443 | 
             
            - test/raw-records/test-table.rb
         | 
| 397 | 
            -
            - test/raw-records/test- | 
| 444 | 
            +
            - test/raw-records/test-basic-arrays.rb
         | 
| 398 445 | 
             
            - test/raw-records/test-list-array.rb
         | 
| 399 | 
            -
            - test/raw-records/test- | 
| 400 | 
            -
            - test/test- | 
| 401 | 
            -
            - test/test- | 
| 402 | 
            -
            - test/test- | 
| 403 | 
            -
            - test/test- | 
| 404 | 
            -
            - test/test- | 
| 405 | 
            -
            - test/test- | 
| 406 | 
            -
            - test/test-record-batch-file-reader.rb
         | 
| 407 | 
            -
            - test/test-rolling-window.rb
         | 
| 408 | 
            -
            - test/test-list-array-builder.rb
         | 
| 409 | 
            -
            - test/test-slicer.rb
         | 
| 446 | 
            +
            - test/raw-records/test-dense-union-array.rb
         | 
| 447 | 
            +
            - test/raw-records/test-sparse-union-array.rb
         | 
| 448 | 
            +
            - test/raw-records/test-multiple-columns.rb
         | 
| 449 | 
            +
            - test/test-array.rb
         | 
| 450 | 
            +
            - test/test-file-output-stream.rb
         | 
| 451 | 
            +
            - test/test-record-batch-iterator.rb
         | 
| 452 | 
            +
            - test/test-tensor.rb
         | 
| 410 453 | 
             
            - test/test-decimal128-array-builder.rb
         | 
| 454 | 
            +
            - test/test-chunked-array.rb
         | 
| 411 455 | 
             
            - test/test-schema.rb
         | 
| 412 | 
            -
            - test/test- | 
| 413 | 
            -
            - test/test-column.rb
         | 
| 414 | 
            -
            - test/test-bigdecimal.rb
         | 
| 415 | 
            -
            - test/test-sparse-union-data-type.rb
         | 
| 416 | 
            -
            - test/test-dictionary-array.rb
         | 
| 417 | 
            -
            - test/test-tensor.rb
         | 
| 418 | 
            -
            - test/test-time32-array.rb
         | 
| 419 | 
            -
            - test/test-buffer.rb
         | 
| 420 | 
            -
            - test/test-decimal128-array.rb
         | 
| 421 | 
            -
            - test/helper/omittable.rb
         | 
| 456 | 
            +
            - test/test-struct-array-builder.rb
         | 
| 422 457 | 
             
            - test/helper/fixture.rb
         | 
| 423 | 
            -
            - test/ | 
| 424 | 
            -
            - test/test- | 
| 425 | 
            -
            - test/test-field.rb
         | 
| 426 | 
            -
            - test/test-record-batch-iterator.rb
         | 
| 427 | 
            -
            - test/test-struct-array.rb
         | 
| 458 | 
            +
            - test/helper/omittable.rb
         | 
| 459 | 
            +
            - test/test-time32-array.rb
         |