red-arrow 14.0.2 → 15.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/arrow/extconf.rb +1 -1
- data/lib/arrow/array.rb +1 -1
- data/lib/arrow/chunked-array.rb +8 -0
- data/lib/arrow/sort-key.rb +3 -3
- data/lib/arrow/table-loader.rb +7 -1
- data/lib/arrow/version.rb +1 -1
- data/test/helper/omittable.rb +5 -0
- data/test/helper.rb +1 -0
- data/test/test-ractor.rb +34 -0
- data/test/test-table.rb +25 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c240a7d115cb94464f4533524e1d3e780670515f134e18932bab704b678886dc
|
4
|
+
data.tar.gz: b87890b494ca08fe170fed3a6617f7382376d545601c7cf6122c5b3dd8b29819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a0cde63d10334e1ff26a97c43df97953f47f67f8f26240beeb9eec95ca664a751cf56767368612aac602857fbb626cfb91cc000cf7cf1d9971f432b305cbcf5
|
7
|
+
data.tar.gz: 9cb25845895d751ea6c69605726a58ea401b43d97bc6e2e0f7786d0c9f86598f33256182dfdfc48908a094dec465d38f9e029be44877f032b12c8443318d62a6
|
data/ext/arrow/extconf.rb
CHANGED
@@ -84,7 +84,7 @@ when /darwin/
|
|
84
84
|
symbols_in_external_bundles.each do |symbol|
|
85
85
|
$DLDFLAGS << " -Wl,-U,#{symbol}"
|
86
86
|
end
|
87
|
-
mmacosx_version_min = "-mmacosx-version-min=10.
|
87
|
+
mmacosx_version_min = "-mmacosx-version-min=10.15"
|
88
88
|
$CFLAGS << " #{mmacosx_version_min}"
|
89
89
|
$CXXFLAGS << " #{mmacosx_version_min}"
|
90
90
|
end
|
data/lib/arrow/array.rb
CHANGED
@@ -250,7 +250,7 @@ module Arrow
|
|
250
250
|
"[array][resolve] need to implement " +
|
251
251
|
"a feature that building #{value_data_type} array " +
|
252
252
|
"from raw Ruby Array"
|
253
|
-
raise
|
253
|
+
raise NotImplemented, message
|
254
254
|
end
|
255
255
|
other_array
|
256
256
|
elsif other_array.respond_to?(:value_data_type)
|
data/lib/arrow/chunked-array.rb
CHANGED
data/lib/arrow/sort-key.rb
CHANGED
@@ -79,9 +79,9 @@ module Arrow
|
|
79
79
|
# target and corresponding order is used. `"+"` uses ascending
|
80
80
|
# order and `"-"` uses ascending order.
|
81
81
|
#
|
82
|
-
# If `target` is not a String
|
83
|
-
# leading order mark, sort column
|
84
|
-
# ascending order is used.
|
82
|
+
# If `target` is either not a String or `target` doesn't start
|
83
|
+
# with the leading order mark, sort column is `target` as-is
|
84
|
+
# and ascending order is used.
|
85
85
|
#
|
86
86
|
# @example String without the leading order mark
|
87
87
|
# key = Arrow::SortKey.new("count")
|
data/lib/arrow/table-loader.rb
CHANGED
@@ -252,7 +252,13 @@ module Arrow
|
|
252
252
|
|
253
253
|
def load_as_json
|
254
254
|
open_input_stream do |input|
|
255
|
-
|
255
|
+
options = JSONReadOptions.new
|
256
|
+
@options.each do |key, value|
|
257
|
+
next if value.nil?
|
258
|
+
setter = :"#{key}="
|
259
|
+
options.__send__(setter, value) if options.respond_to?(setter)
|
260
|
+
end
|
261
|
+
reader = JSONReader.new(input, options)
|
256
262
|
table = reader.read
|
257
263
|
table.refer_input(input)
|
258
264
|
table
|
data/lib/arrow/version.rb
CHANGED
data/test/helper/omittable.rb
CHANGED
@@ -17,6 +17,11 @@
|
|
17
17
|
|
18
18
|
module Helper
|
19
19
|
module Omittable
|
20
|
+
def require_ruby(major, minor, micro=0)
|
21
|
+
return if (RUBY_VERSION <=> "#{major}.#{minor}.#{micro}") >= 0
|
22
|
+
omit("Require Ruby #{major}.#{minor}.#{micro} or later: #{RUBY_VERSION}")
|
23
|
+
end
|
24
|
+
|
20
25
|
def require_gi_bindings(major, minor, micro)
|
21
26
|
return if GLib.check_binding_version?(major, minor, micro)
|
22
27
|
message =
|
data/test/helper.rb
CHANGED
data/test/test-ractor.rb
ADDED
@@ -0,0 +1,34 @@
|
|
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 RactorTest < Test::Unit::TestCase
|
19
|
+
include Helper::Omittable
|
20
|
+
|
21
|
+
ractor
|
22
|
+
test("ChunkedArray") do
|
23
|
+
require_ruby(3, 1, 0)
|
24
|
+
array = Arrow::Array.new([1, 2, 3])
|
25
|
+
chunked_array = Arrow::ChunkedArray.new([array])
|
26
|
+
Ractor.make_shareable(chunked_array)
|
27
|
+
ractor = Ractor.new do
|
28
|
+
recived_chunked_array = Ractor.receive
|
29
|
+
recived_chunked_array.chunks
|
30
|
+
end
|
31
|
+
ractor.send(chunked_array)
|
32
|
+
assert_equal([array], ractor.take)
|
33
|
+
end
|
34
|
+
end
|
data/test/test-table.rb
CHANGED
@@ -677,6 +677,31 @@ class TableTest < Test::Unit::TestCase
|
|
677
677
|
format: :tsv,
|
678
678
|
schema: @table.schema))
|
679
679
|
end
|
680
|
+
|
681
|
+
def test_json
|
682
|
+
output = create_output(".json")
|
683
|
+
# TODO: Implement this.
|
684
|
+
# @table.save(output, format: :json)
|
685
|
+
columns = ""
|
686
|
+
@table.each_record.each do |record|
|
687
|
+
column = {
|
688
|
+
"count" => record.count,
|
689
|
+
"visible" => record.visible,
|
690
|
+
}
|
691
|
+
columns << column.to_json
|
692
|
+
columns << "\n"
|
693
|
+
end
|
694
|
+
if output.is_a?(String)
|
695
|
+
File.write(output, columns)
|
696
|
+
else
|
697
|
+
output.resize(columns.bytesize)
|
698
|
+
output.set_data(0, columns)
|
699
|
+
end
|
700
|
+
assert_equal(@table,
|
701
|
+
Arrow::Table.load(output,
|
702
|
+
format: :json,
|
703
|
+
schema: @table.schema))
|
704
|
+
end
|
680
705
|
end
|
681
706
|
|
682
707
|
sub_test_case("path") do
|
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:
|
4
|
+
version: 15.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apache Arrow Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|
@@ -307,6 +307,7 @@ files:
|
|
307
307
|
- test/test-memory-view.rb
|
308
308
|
- test/test-null-array.rb
|
309
309
|
- test/test-orc.rb
|
310
|
+
- test/test-ractor.rb
|
310
311
|
- test/test-record-batch-builder.rb
|
311
312
|
- test/test-record-batch-file-reader.rb
|
312
313
|
- test/test-record-batch-iterator.rb
|
@@ -346,7 +347,7 @@ homepage: https://arrow.apache.org/
|
|
346
347
|
licenses:
|
347
348
|
- Apache-2.0
|
348
349
|
metadata:
|
349
|
-
msys2_mingw_dependencies: arrow>=
|
350
|
+
msys2_mingw_dependencies: arrow>=15.0.1
|
350
351
|
post_install_message:
|
351
352
|
rdoc_options: []
|
352
353
|
require_paths:
|
@@ -442,6 +443,7 @@ test_files:
|
|
442
443
|
- test/test-memory-view.rb
|
443
444
|
- test/test-null-array.rb
|
444
445
|
- test/test-orc.rb
|
446
|
+
- test/test-ractor.rb
|
445
447
|
- test/test-record-batch-builder.rb
|
446
448
|
- test/test-record-batch-file-reader.rb
|
447
449
|
- test/test-record-batch-iterator.rb
|