red-parquet 12.0.1 → 14.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fe427ed5aff2e561afc4965ecfecc83d18668ebdac7955492a49e444cb30fa5
4
- data.tar.gz: 387df336a8f17cf8e9b32ae31c8253ac80346778cf6bf809120a0548be41ba6d
3
+ metadata.gz: 8cad636ae5f27842cb134a39ae0abaabf91eadae5f4349a65b5985347e83f4dc
4
+ data.tar.gz: 486195624d0ffec4539a9475aa84635af83fd43458e9943876978345b6af9436
5
5
  SHA512:
6
- metadata.gz: ed0fec585983d5a04b1717790f56e827af6e0aaacd76253a00189f711dc695144514432371ed5f0e611a65053bf852aef70179056430ce4d56ab4f0884c12f05
7
- data.tar.gz: 75fc2091d7aceea63b019b2d5055460016e553def26ebc187458c2b7092bfa3ee94b7eada8ffb849c0eb7d72bb4d58c4c84b3bee8c9fbc28cb6ad4c39d3b9bba
6
+ metadata.gz: 84e44b345e34097f45b9e1e463e2969e47c4d511aff640f852de3ffc285cf1c336d27c21365ec5789733f64f972c4e36e1200154737cee2e9ec7cc2e07459cca
7
+ data.tar.gz: ed680882d8e9ef23087944f9b0aba03252a7be4869d1d2ba6eff8e462f671d1462a679419859179b157df229a0b4aa37fe69d815e4c50f79932adb3e848ba0bd
@@ -0,0 +1,28 @@
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 Parquet
19
+ class ArrowFileReader
20
+ def each_row_group
21
+ return to_enum(__method__) {n_row_groups} unless block_given?
22
+
23
+ n_row_groups.times do |i|
24
+ yield(read_row_group(i))
25
+ end
26
+ end
27
+ end
28
+ end
@@ -29,6 +29,7 @@ module Parquet
29
29
  end
30
30
 
31
31
  def require_libraries
32
+ require "parquet/arrow-file-reader"
32
33
  require "parquet/arrow-table-loadable"
33
34
  require "parquet/arrow-table-savable"
34
35
  require "parquet/writer-properties"
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
 
18
18
  module Parquet
19
- VERSION = "12.0.1"
19
+ VERSION = "14.0.0"
20
20
 
21
21
  module Version
22
22
  numbers, TAG = VERSION.split("-")
@@ -0,0 +1,66 @@
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 TestArrowFileReader < Test::Unit::TestCase
19
+ def setup
20
+ @schema = Arrow::Schema.new(visible: :boolean)
21
+ table = Arrow::Table.new(@schema, [[true], [false]])
22
+ Tempfile.create(["red-parquet", ".parquet"]) do |file|
23
+ @file = file
24
+ Parquet::ArrowFileWriter.open(table.schema, @file.path) do |writer|
25
+ chunk_size = 1
26
+ writer.write_table(table, chunk_size)
27
+ end
28
+ yield
29
+ end
30
+ end
31
+
32
+ sub_test_case("#each_row_group") do
33
+ test("block") do
34
+ Arrow::FileInputStream.open(@file.path) do |input|
35
+ reader = Parquet::ArrowFileReader.new(input)
36
+ row_groups = []
37
+ reader.each_row_group do |row_group|
38
+ row_groups << row_group
39
+ end
40
+ assert_equal([
41
+ Arrow::Table.new(@schema, [[true]]),
42
+ Arrow::Table.new(@schema, [[false]])
43
+ ],
44
+ row_groups)
45
+ end
46
+ end
47
+
48
+ test("without block") do
49
+ Arrow::FileInputStream.open(@file.path) do |input|
50
+ reader = Parquet::ArrowFileReader.new(input)
51
+ each_row_group = reader.each_row_group
52
+ assert_equal({
53
+ size: 2,
54
+ to_a: [
55
+ Arrow::Table.new(@schema, [[true]]),
56
+ Arrow::Table.new(@schema, [[false]])
57
+ ],
58
+ },
59
+ {
60
+ size: each_row_group.size,
61
+ to_a: each_row_group.to_a,
62
+ })
63
+ end
64
+ end
65
+ end
66
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-parquet
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.1
4
+ version: 14.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: 2023-06-15 00:00:00.000000000 Z
11
+ date: 2023-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: red-arrow
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 12.0.1
19
+ version: 14.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 12.0.1
26
+ version: 14.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -81,6 +81,7 @@ files:
81
81
  - Rakefile
82
82
  - dependency-check/Rakefile
83
83
  - lib/parquet.rb
84
+ - lib/parquet/arrow-file-reader.rb
84
85
  - lib/parquet/arrow-table-loadable.rb
85
86
  - lib/parquet/arrow-table-savable.rb
86
87
  - lib/parquet/loader.rb
@@ -89,13 +90,14 @@ files:
89
90
  - red-parquet.gemspec
90
91
  - test/helper.rb
91
92
  - test/run-test.rb
93
+ - test/test-arrow-file-reader.rb
92
94
  - test/test-arrow-table.rb
93
95
  - test/test-boolean-statistics.rb
94
96
  homepage: https://arrow.apache.org/
95
97
  licenses:
96
98
  - Apache-2.0
97
99
  metadata: {}
98
- post_install_message:
100
+ post_install_message:
99
101
  rdoc_options: []
100
102
  require_paths:
101
103
  - lib
@@ -110,12 +112,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
112
  - !ruby/object:Gem::Version
111
113
  version: '0'
112
114
  requirements: []
113
- rubygems_version: 3.3.5
114
- signing_key:
115
+ rubygems_version: 3.5.0.dev
116
+ signing_key:
115
117
  specification_version: 4
116
118
  summary: Red Parquet is the Ruby bindings of Apache Parquet
117
119
  test_files:
118
120
  - test/helper.rb
119
121
  - test/run-test.rb
122
+ - test/test-arrow-file-reader.rb
120
123
  - test/test-arrow-table.rb
121
124
  - test/test-boolean-statistics.rb