red-arrow 17.0.0 → 18.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 219ff5131490e19062c8ec0813d2478182b0e4804fd3b574cfae56c684fe14a2
4
- data.tar.gz: e3a579210e075a7bf2bae488ab59d4c764efdddf6a684d2ec3bf85d121f0aca3
3
+ metadata.gz: 16f24185f6f94f5d5a0179be6d20f289eb2b91fef831c12d1bbd48228c5ee7c0
4
+ data.tar.gz: 2cb5d5b9adfb6db6b21bb05d35e0dbbbbfbf9a21c9df43ea9b8bca51b93ff19b
5
5
  SHA512:
6
- metadata.gz: ed735f057c60826172842e0f9a24e23ac950e8a972bb5e3b9d0ab0b5dc16ee87e4996a5f0552cb97e70f1e134c882372110c488945ad8d12e548c55234e40d5b
7
- data.tar.gz: ae524564569d6889e2cde7616f5e937490c30ae55a4c3e362af4af0ef4444f2062fb3910164c55ba29cb4d34c3f158abb478d9d8332024bf85a68beff8f069e8
6
+ metadata.gz: 9521cbc2dd710008ef9e7d671aa65a739867a0903e5878fbbfe99ef2dc4aba71575c8b90937b9eac0068a5c6dc2caf784551e6b206c3ca8feaf1ebb400f7af7e
7
+ data.tar.gz: 78fa402f9021f9a7511ff518f8fc81e2f748b50a80f60fdb8f7d6cc6ec6a1715ad14c26f2f2c08f76ad1dab0e3a26ca5ce16c710c8868198b806524c8e979f48
data/ext/arrow/extconf.rb CHANGED
@@ -66,6 +66,13 @@ unless required_pkg_config_package([
66
66
  exit(false)
67
67
  end
68
68
 
69
+ # Old re2.pc (e.g. re2.pc on Ubuntu 20.04) may add -std=c++11. It
70
+ # causes a build error because Apache Arrow C++ requires C++17 or
71
+ # later.
72
+ #
73
+ # We can remove this when we drop support for Ubuntu 20.04.
74
+ $CXXFLAGS.gsub!("-std=c++11", "")
75
+
69
76
  [
70
77
  ["glib2", "ext/glib2"],
71
78
  ].each do |name, relative_source_dir|
@@ -84,7 +91,7 @@ when /darwin/
84
91
  symbols_in_external_bundles.each do |symbol|
85
92
  $DLDFLAGS << " -Wl,-U,#{symbol}"
86
93
  end
87
- mmacosx_version_min = "-mmacosx-version-min=10.15"
94
+ mmacosx_version_min = "-mmacosx-version-min=12.0"
88
95
  $CFLAGS << " #{mmacosx_version_min}"
89
96
  $CXXFLAGS << " #{mmacosx_version_min}"
90
97
  end
data/lib/arrow/loader.rb CHANGED
@@ -116,6 +116,8 @@ module Arrow
116
116
  require "arrow/sparse-union-data-type"
117
117
  require "arrow/string-dictionary-array-builder"
118
118
  require "arrow/string-array-builder"
119
+ require "arrow/stream-decoder"
120
+ require "arrow/stream-listener"
119
121
  require "arrow/struct-array"
120
122
  require "arrow/struct-array-builder"
121
123
  require "arrow/struct-data-type"
@@ -168,6 +170,16 @@ module Arrow
168
170
  end
169
171
  end
170
172
 
173
+ def rubyish_class_name(info)
174
+ name = info.name
175
+ case name
176
+ when "StreamListener"
177
+ "StreamListenerRaw"
178
+ else
179
+ super
180
+ end
181
+ end
182
+
171
183
  def load_object_info(info)
172
184
  super
173
185
 
@@ -0,0 +1,29 @@
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
+ module Arrow
19
+ class StreamDecoder
20
+ def consume(data)
21
+ case data
22
+ when Buffer
23
+ consume_buffer(data)
24
+ else
25
+ consume_bytes(data)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,47 @@
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
+ module Arrow
19
+ class StreamListener < StreamListenerRaw
20
+ type_register
21
+
22
+ def on_eos
23
+ end
24
+
25
+ def on_record_batch_decoded(record_batch, metadata)
26
+ end
27
+
28
+ def on_schema(schema, filtered_schema)
29
+ end
30
+
31
+ private
32
+ def virtual_do_on_eos
33
+ on_eos
34
+ true
35
+ end
36
+
37
+ def virtual_do_on_record_batch_decoded(record_batch, metadata)
38
+ on_record_batch_decoded(record_batch, metadata)
39
+ true
40
+ end
41
+
42
+ def virtual_do_on_schema_decoded(schema, filtered_schema)
43
+ on_schema_decoded(schema, filtered_schema)
44
+ true
45
+ end
46
+ end
47
+ end
data/lib/arrow/version.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
 
18
18
  module Arrow
19
- VERSION = "17.0.0"
19
+ VERSION = "18.0.0"
20
20
 
21
21
  module Version
22
22
  numbers, TAG = VERSION.split("-")
data/red-arrow.gemspec CHANGED
@@ -49,7 +49,7 @@ Gem::Specification.new do |spec|
49
49
  spec.add_runtime_dependency("bigdecimal", ">= 3.1.0")
50
50
  spec.add_runtime_dependency("csv")
51
51
  spec.add_runtime_dependency("extpp", ">= 0.1.1")
52
- spec.add_runtime_dependency("gio2", ">= 3.5.0")
52
+ spec.add_runtime_dependency("gio2", ">= 4.2.3")
53
53
  spec.add_runtime_dependency("native-package-installer")
54
54
  spec.add_runtime_dependency("pkg-config")
55
55
 
@@ -38,4 +38,10 @@ class Decimal128ArrayTest < Test::Unit::TestCase
38
38
  array.to_a)
39
39
  end
40
40
  end
41
+
42
+ def test_zero
43
+ array = Arrow::Decimal128Array.new({precision: 38, scale: 9},
44
+ [BigDecimal("0")])
45
+ assert_equal(BigDecimal("0"), array[0])
46
+ end
41
47
  end
@@ -38,4 +38,10 @@ class Decimal256ArrayTest < Test::Unit::TestCase
38
38
  array.to_a)
39
39
  end
40
40
  end
41
+
42
+ def test_zero
43
+ array = Arrow::Decimal256Array.new({precision: 38, scale: 9},
44
+ [BigDecimal("0")])
45
+ assert_equal(BigDecimal("0"), array[0])
46
+ end
41
47
  end
@@ -0,0 +1,60 @@
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 TestStreamListener < Test::Unit::TestCase
19
+ class Listener < Arrow::StreamListener
20
+ attr_reader :events
21
+ def initialize
22
+ super
23
+ @events = []
24
+ end
25
+
26
+ def on_eos
27
+ @events << [:eos]
28
+ end
29
+
30
+ def on_record_batch_decoded(record_batch, metadata)
31
+ @events << [:record_batch_decoded, record_batch, metadata]
32
+ end
33
+
34
+ def on_schema_decoded(schema, filtered_schema)
35
+ @events << [:schema_decoded, schema, filtered_schema]
36
+ end
37
+ end
38
+
39
+ def setup
40
+ @record_batch = Arrow::RecordBatch.new(enabled: [true, false, nil, true])
41
+ @schema = @record_batch.schema
42
+
43
+ @buffer = Arrow::ResizableBuffer.new(0)
44
+ table = Arrow::Table.new(@schema, [@record_batch])
45
+ table.save(@buffer, format: :stream)
46
+
47
+ @listener = Listener.new
48
+ @decoder = Arrow::StreamDecoder.new(@listener)
49
+ end
50
+
51
+ def test_consume
52
+ @decoder.consume(@buffer)
53
+ assert_equal([
54
+ [:schema_decoded, @schema, @schema],
55
+ [:record_batch_decoded, @record_batch, nil],
56
+ [:eos],
57
+ ],
58
+ @listener.events)
59
+ end
60
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-arrow
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.0.0
4
+ version: 18.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: 2024-07-19 00:00:00.000000000 Z
11
+ date: 2024-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 3.5.0
61
+ version: 4.2.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 3.5.0
68
+ version: 4.2.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: native-package-installer
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -203,6 +203,8 @@ files:
203
203
  - lib/arrow/sparse-union-array-builder.rb
204
204
  - lib/arrow/sparse-union-array.rb
205
205
  - lib/arrow/sparse-union-data-type.rb
206
+ - lib/arrow/stream-decoder.rb
207
+ - lib/arrow/stream-listener.rb
206
208
  - lib/arrow/string-array-builder.rb
207
209
  - lib/arrow/string-dictionary-array-builder.rb
208
210
  - lib/arrow/struct-array-builder.rb
@@ -324,6 +326,7 @@ files:
324
326
  - test/test-sort-options.rb
325
327
  - test/test-sparse-union-array.rb
326
328
  - test/test-sparse-union-data-type.rb
329
+ - test/test-stream-listener.rb
327
330
  - test/test-string-dictionary-array-builder.rb
328
331
  - test/test-struct-array-builder.rb
329
332
  - test/test-struct-array.rb
@@ -348,8 +351,8 @@ homepage: https://arrow.apache.org/
348
351
  licenses:
349
352
  - Apache-2.0
350
353
  metadata:
351
- msys2_mingw_dependencies: arrow>=17.0.0
352
- post_install_message:
354
+ msys2_mingw_dependencies: arrow>=18.0.0
355
+ post_install_message:
353
356
  rdoc_options: []
354
357
  require_paths:
355
358
  - lib
@@ -364,8 +367,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
364
367
  - !ruby/object:Gem::Version
365
368
  version: '0'
366
369
  requirements: []
367
- rubygems_version: 3.3.5
368
- signing_key:
370
+ rubygems_version: 3.4.20
371
+ signing_key:
369
372
  specification_version: 4
370
373
  summary: Red Arrow is the Ruby bindings of Apache Arrow
371
374
  test_files:
@@ -460,6 +463,7 @@ test_files:
460
463
  - test/test-sort-options.rb
461
464
  - test/test-sparse-union-array.rb
462
465
  - test/test-sparse-union-data-type.rb
466
+ - test/test-stream-listener.rb
463
467
  - test/test-string-dictionary-array-builder.rb
464
468
  - test/test-struct-array-builder.rb
465
469
  - test/test-struct-array.rb