red-arrow 0.12.0 → 0.13.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.

Potentially problematic release.


This version of red-arrow might be problematic. Click here for more details.

Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +49 -4
  3. data/ext/arrow/arrow.cpp +43 -0
  4. data/ext/arrow/extconf.rb +52 -0
  5. data/ext/arrow/record-batch.cpp +756 -0
  6. data/ext/arrow/red-arrow.hpp +60 -0
  7. data/lib/arrow.rb +2 -1
  8. data/lib/arrow/array-builder.rb +4 -0
  9. data/lib/arrow/array.rb +11 -1
  10. data/lib/arrow/bigdecimal-extension.rb +24 -0
  11. data/lib/arrow/binary-array-builder.rb +36 -0
  12. data/lib/arrow/block-closable.rb +5 -1
  13. data/lib/arrow/csv-loader.rb +28 -6
  14. data/lib/arrow/data-type.rb +8 -4
  15. data/lib/arrow/decimal128-array-builder.rb +2 -2
  16. data/lib/arrow/decimal128.rb +42 -0
  17. data/lib/arrow/list-array-builder.rb +1 -1
  18. data/lib/arrow/loader.rb +8 -0
  19. data/lib/arrow/null-array-builder.rb +26 -0
  20. data/lib/arrow/record-batch-builder.rb +8 -9
  21. data/lib/arrow/struct-array-builder.rb +3 -3
  22. data/lib/arrow/struct-array.rb +15 -7
  23. data/lib/arrow/struct.rb +11 -0
  24. data/lib/arrow/table-loader.rb +14 -14
  25. data/lib/arrow/version.rb +1 -1
  26. data/red-arrow.gemspec +8 -4
  27. data/test/raw-records/record-batch/test-basic-arrays.rb +349 -0
  28. data/test/raw-records/record-batch/test-dense-union-array.rb +486 -0
  29. data/test/raw-records/record-batch/test-list-array.rb +498 -0
  30. data/test/raw-records/record-batch/test-multiple-columns.rb +49 -0
  31. data/test/raw-records/record-batch/test-sparse-union-array.rb +474 -0
  32. data/test/raw-records/record-batch/test-struct-array.rb +426 -0
  33. data/test/run-test.rb +25 -2
  34. data/test/test-array.rb +38 -9
  35. data/test/test-bigdecimal.rb +23 -0
  36. data/{dependency-check/Rakefile → test/test-buffer.rb} +15 -20
  37. data/test/test-chunked-array.rb +22 -0
  38. data/test/test-column.rb +24 -0
  39. data/test/test-csv-loader.rb +30 -0
  40. data/test/test-data-type.rb +25 -0
  41. data/test/test-decimal128.rb +64 -0
  42. data/test/test-field.rb +20 -0
  43. data/test/test-group.rb +2 -2
  44. data/test/test-record-batch-builder.rb +9 -0
  45. data/test/test-record-batch.rb +14 -0
  46. data/test/test-schema.rb +14 -0
  47. data/test/test-struct-array.rb +16 -3
  48. data/test/test-table.rb +14 -0
  49. data/test/test-tensor.rb +56 -0
  50. metadata +117 -47
@@ -0,0 +1,56 @@
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 TensorTest < Test::Unit::TestCase
19
+ sub_test_case("instance methods") do
20
+ def setup
21
+ raw_data = [
22
+ 1, 2,
23
+ 3, 4,
24
+
25
+ 5, 6,
26
+ 7, 8,
27
+
28
+ 9, 10,
29
+ 11, 12,
30
+ ]
31
+ data = Arrow::Buffer.new(raw_data.pack("c*"))
32
+ shape = [3, 2, 2]
33
+ strides = []
34
+ names = ["a", "b", "c"]
35
+ @tensor = Arrow::Tensor.new(Arrow::Int8DataType.new,
36
+ data,
37
+ shape,
38
+ strides,
39
+ names)
40
+ end
41
+
42
+ sub_test_case("#==") do
43
+ test("Arrow::Tensor") do
44
+ assert do
45
+ @tensor == @tensor
46
+ end
47
+ end
48
+
49
+ test("not Arrow::Tensor") do
50
+ assert do
51
+ not (@tensor == 29)
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
metadata CHANGED
@@ -1,31 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red-arrow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
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: 2019-01-19 00:00:00.000000000 Z
11
+ date: 2019-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: gobject-introspection
14
+ name: extpp
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.1
19
+ version: 0.0.7
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: 3.3.1
26
+ version: 0.0.7
27
27
  - !ruby/object:Gem::Dependency
28
- name: pkg-config
28
+ name: gio2
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 3.3.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 3.3.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: native-package-installer
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
@@ -39,7 +53,7 @@ dependencies:
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: native-package-installer
56
+ name: pkg-config
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - ">="
@@ -52,6 +66,20 @@ dependencies:
52
66
  - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: benchmark-driver
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: bundler
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +94,20 @@ dependencies:
66
94
  - - ">="
67
95
  - !ruby/object:Gem::Version
68
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: faker
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: rake
71
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,7 +170,7 @@ email:
128
170
  - dev@arrow.apache.org
129
171
  executables: []
130
172
  extensions:
131
- - dependency-check/Rakefile
173
+ - ext/arrow/extconf.rb
132
174
  extra_rdoc_files: []
133
175
  files:
134
176
  - Gemfile
@@ -136,12 +178,17 @@ files:
136
178
  - NOTICE.txt
137
179
  - README.md
138
180
  - Rakefile
139
- - dependency-check/Rakefile
140
181
  - doc/text/development.md
182
+ - ext/arrow/arrow.cpp
183
+ - ext/arrow/extconf.rb
184
+ - ext/arrow/record-batch.cpp
185
+ - ext/arrow/red-arrow.hpp
141
186
  - image/red-arrow.png
142
187
  - lib/arrow.rb
143
188
  - lib/arrow/array-builder.rb
144
189
  - lib/arrow/array.rb
190
+ - lib/arrow/bigdecimal-extension.rb
191
+ - lib/arrow/binary-array-builder.rb
145
192
  - lib/arrow/block-closable.rb
146
193
  - lib/arrow/chunked-array.rb
147
194
  - lib/arrow/column.rb
@@ -155,6 +202,7 @@ files:
155
202
  - lib/arrow/date64-array.rb
156
203
  - lib/arrow/decimal128-array-builder.rb
157
204
  - lib/arrow/decimal128-data-type.rb
205
+ - lib/arrow/decimal128.rb
158
206
  - lib/arrow/dense-union-data-type.rb
159
207
  - lib/arrow/dictionary-data-type.rb
160
208
  - lib/arrow/field-containable.rb
@@ -164,6 +212,7 @@ files:
164
212
  - lib/arrow/list-array-builder.rb
165
213
  - lib/arrow/list-data-type.rb
166
214
  - lib/arrow/loader.rb
215
+ - lib/arrow/null-array-builder.rb
167
216
  - lib/arrow/path-extension.rb
168
217
  - lib/arrow/record-batch-builder.rb
169
218
  - lib/arrow/record-batch-file-reader.rb
@@ -205,9 +254,17 @@ files:
205
254
  - test/fixture/without-header.csv
206
255
  - test/helper.rb
207
256
  - test/helper/fixture.rb
257
+ - test/raw-records/record-batch/test-basic-arrays.rb
258
+ - test/raw-records/record-batch/test-dense-union-array.rb
259
+ - test/raw-records/record-batch/test-list-array.rb
260
+ - test/raw-records/record-batch/test-multiple-columns.rb
261
+ - test/raw-records/record-batch/test-sparse-union-array.rb
262
+ - test/raw-records/record-batch/test-struct-array.rb
208
263
  - test/run-test.rb
209
264
  - test/test-array-builder.rb
210
265
  - test/test-array.rb
266
+ - test/test-bigdecimal.rb
267
+ - test/test-buffer.rb
211
268
  - test/test-chunked-array.rb
212
269
  - test/test-column.rb
213
270
  - test/test-csv-loader.rb
@@ -217,6 +274,7 @@ files:
217
274
  - test/test-decimal128-array-builder.rb
218
275
  - test/test-decimal128-array.rb
219
276
  - test/test-decimal128-data-type.rb
277
+ - test/test-decimal128.rb
220
278
  - test/test-dense-union-data-type.rb
221
279
  - test/test-dictionary-data-type.rb
222
280
  - test/test-feather.rb
@@ -239,6 +297,7 @@ files:
239
297
  - test/test-struct-data-type.rb
240
298
  - test/test-struct.rb
241
299
  - test/test-table.rb
300
+ - test/test-tensor.rb
242
301
  - test/test-time32-data-type.rb
243
302
  - test/test-time64-data-type.rb
244
303
  - test/test-timestamp-array.rb
@@ -247,7 +306,7 @@ homepage: https://arrow.apache.org/
247
306
  licenses:
248
307
  - Apache-2.0
249
308
  metadata:
250
- msys2_mingw_dependencies: apache-arrow
309
+ msys2_mingw_dependencies: arrow
251
310
  post_install_message:
252
311
  rdoc_options: []
253
312
  require_paths:
@@ -263,57 +322,68 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
322
  - !ruby/object:Gem::Version
264
323
  version: '0'
265
324
  requirements: []
266
- rubygems_version: 3.0.2
325
+ rubyforge_project:
326
+ rubygems_version: 2.7.6.2
267
327
  signing_key:
268
328
  specification_version: 4
269
329
  summary: Red Arrow is the Ruby bindings of Apache Arrow
270
330
  test_files:
271
- - test/test-date64-array.rb
272
- - test/test-schema.rb
331
+ - test/test-record-batch-file-reader.rb
332
+ - test/test-tensor.rb
273
333
  - test/test-dense-union-data-type.rb
274
- - test/test-struct-array-builder.rb
275
- - test/test-csv-loader.rb
276
- - test/test-array.rb
277
- - test/test-decimal128-data-type.rb
278
- - test/test-chunked-array.rb
279
- - test/test-decimal128-array.rb
280
- - test/test-list-data-type.rb
281
- - test/fixture/float-integer.csv
282
- - test/fixture/without-header.csv
283
- - test/fixture/TestOrcFile.test1.orc
334
+ - test/test-time64-data-type.rb
284
335
  - test/fixture/with-header.csv
336
+ - test/fixture/float-integer.csv
337
+ - test/fixture/null-without-double-quote.csv
285
338
  - test/fixture/without-header-float.csv
339
+ - test/fixture/with-header-float.csv
340
+ - test/fixture/without-header.csv
286
341
  - test/fixture/integer-float.csv
287
- - test/fixture/null-without-double-quote.csv
342
+ - test/fixture/TestOrcFile.test1.orc
288
343
  - test/fixture/null-with-double-quote.csv
289
- - test/fixture/with-header-float.csv
290
- - test/test-slicer.rb
291
344
  - test/test-file-output-stream.rb
292
- - test/test-timestamp-array.rb
293
- - test/test-orc.rb
294
- - test/test-rolling-window.rb
295
- - test/test-sparse-union-data-type.rb
296
- - test/test-field.rb
345
+ - test/test-bigdecimal.rb
346
+ - test/test-record-batch-builder.rb
347
+ - test/test-struct.rb
297
348
  - test/test-column.rb
298
- - test/test-struct-data-type.rb
299
- - test/test-decimal128-array-builder.rb
300
- - test/test-table.rb
349
+ - test/test-time32-data-type.rb
350
+ - test/test-struct-array.rb
301
351
  - test/test-array-builder.rb
302
- - test/test-time64-data-type.rb
352
+ - test/test-chunked-array.rb
303
353
  - test/test-list-array.rb
354
+ - test/test-date32-array.rb
355
+ - test/test-field.rb
356
+ - test/test-struct-array-builder.rb
357
+ - test/test-decimal128-array-builder.rb
304
358
  - test/test-record-batch.rb
305
- - test/test-group.rb
306
- - test/test-feather.rb
307
- - test/test-data-type.rb
308
- - test/test-record-batch-builder.rb
309
359
  - test/helper.rb
310
- - test/test-list-array-builder.rb
311
- - test/test-record-batch-file-reader.rb
312
- - test/test-struct.rb
313
- - test/test-struct-array.rb
314
- - test/test-date32-array.rb
315
- - test/helper/fixture.rb
316
- - test/test-timestamp-data-type.rb
360
+ - test/test-orc.rb
361
+ - test/test-struct-data-type.rb
362
+ - test/test-rolling-window.rb
317
363
  - test/run-test.rb
364
+ - test/test-timestamp-data-type.rb
365
+ - test/test-feather.rb
366
+ - test/test-decimal128-data-type.rb
367
+ - test/test-list-data-type.rb
368
+ - test/test-timestamp-array.rb
369
+ - test/test-decimal128-array.rb
370
+ - test/test-table.rb
371
+ - test/test-csv-loader.rb
372
+ - test/test-list-array-builder.rb
373
+ - test/test-array.rb
374
+ - test/test-group.rb
375
+ - test/test-schema.rb
318
376
  - test/test-dictionary-data-type.rb
319
- - test/test-time32-data-type.rb
377
+ - test/test-data-type.rb
378
+ - test/raw-records/record-batch/test-sparse-union-array.rb
379
+ - test/raw-records/record-batch/test-basic-arrays.rb
380
+ - test/raw-records/record-batch/test-multiple-columns.rb
381
+ - test/raw-records/record-batch/test-struct-array.rb
382
+ - test/raw-records/record-batch/test-list-array.rb
383
+ - test/raw-records/record-batch/test-dense-union-array.rb
384
+ - test/test-decimal128.rb
385
+ - test/helper/fixture.rb
386
+ - test/test-date64-array.rb
387
+ - test/test-buffer.rb
388
+ - test/test-sparse-union-data-type.rb
389
+ - test/test-slicer.rb