red-arrow 8.0.0 → 24.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/README.md +15 -7
- data/ext/arrow/arrow.cpp +67 -0
- data/ext/arrow/converters.cpp +10 -0
- data/ext/arrow/converters.hpp +310 -46
- data/ext/arrow/extconf.rb +41 -22
- data/ext/arrow/raw-records.cpp +165 -2
- data/ext/arrow/red-arrow.hpp +2 -0
- data/ext/arrow/values.cpp +6 -2
- data/lib/arrow/array-builder.rb +89 -14
- data/{test/test-time32-data-type.rb → lib/arrow/array-computable.rb} +24 -16
- data/{test/test-buffer.rb → lib/arrow/array-statistics.rb} +19 -24
- data/lib/arrow/array.rb +40 -4
- data/lib/arrow/chunked-array.rb +56 -1
- data/lib/arrow/column-containable.rb +9 -0
- data/lib/arrow/column.rb +49 -4
- data/{test/test-tensor.rb → lib/arrow/csv-write-options.rb} +28 -31
- data/lib/arrow/data-type.rb +17 -3
- data/lib/arrow/decimal128-array-builder.rb +16 -6
- data/lib/arrow/decimal128.rb +14 -0
- data/lib/arrow/decimal256-array-builder.rb +16 -6
- data/lib/arrow/decimal256.rb +14 -0
- data/{test/test-float-scalar.rb → lib/arrow/dense-union-array-builder.rb} +27 -24
- data/{test/test-boolean-scalar.rb → lib/arrow/dense-union-array.rb} +7 -7
- data/lib/arrow/duration-array-builder.rb +27 -0
- data/lib/arrow/duration-array.rb +24 -0
- data/lib/arrow/duration-data-type.rb +32 -0
- data/lib/arrow/expression.rb +6 -2
- data/lib/arrow/field-containable.rb +1 -1
- data/lib/arrow/field.rb +44 -3
- data/lib/arrow/fixed-size-list-array-builder.rb +29 -0
- data/lib/arrow/fixed-size-list-data-type.rb +118 -0
- data/lib/arrow/function.rb +0 -1
- data/lib/arrow/half-float-array-builder.rb +32 -0
- data/lib/arrow/half-float-array.rb +24 -0
- data/lib/arrow/half-float.rb +118 -0
- data/{test/helper/fixture.rb → lib/arrow/input-referable.rb} +7 -6
- data/lib/arrow/jruby/array-builder.rb +114 -0
- data/lib/arrow/jruby/array.rb +109 -0
- data/lib/arrow/jruby/chunked-array.rb +36 -0
- data/lib/arrow/jruby/compression-type.rb +26 -0
- data/lib/arrow/jruby/csv-read-options.rb +32 -0
- data/{test/test-map-data-type.rb → lib/arrow/jruby/data-type.rb} +24 -12
- data/lib/arrow/jruby/decimal128.rb +28 -0
- data/lib/arrow/jruby/decimal256.rb +28 -0
- data/{test/fixture/float-integer.csv → lib/arrow/jruby/error.rb} +7 -4
- data/lib/arrow/jruby/file-system.rb +24 -0
- data/{test/test-null-array.rb → lib/arrow/jruby/function.rb} +5 -4
- data/lib/arrow/jruby/record-batch-iterator.rb +24 -0
- data/{test/fixture/null-with-double-quote.csv → lib/arrow/jruby/record-batch.rb} +8 -4
- data/{test/fixture/integer-float.csv → lib/arrow/jruby/sort-key.rb} +8 -4
- data/lib/arrow/jruby/sort-options.rb +24 -0
- data/lib/arrow/jruby/stream-listener-raw.rb +25 -0
- data/{test/test-rolling-window.rb → lib/arrow/jruby/table.rb} +19 -19
- data/lib/arrow/jruby/writable.rb +24 -0
- data/lib/arrow/jruby.rb +52 -0
- data/{test/test-date32-array.rb → lib/arrow/large-list-array-builder.rb} +10 -5
- data/lib/arrow/large-list-data-type.rb +83 -0
- data/lib/arrow/libraries.rb +140 -0
- data/lib/arrow/list-array-builder.rb +1 -68
- data/lib/arrow/list-data-type.rb +3 -38
- data/{test/test-dictionary-array.rb → lib/arrow/list-field-resolvable.rb} +26 -17
- data/lib/arrow/list-slice-options.rb +76 -0
- data/lib/arrow/list-values-appendable.rb +88 -0
- data/lib/arrow/loader.rb +15 -96
- data/{test/test-decimal128-array.rb → lib/arrow/make-struct-options.rb} +18 -18
- data/lib/arrow/raw-table-converter.rb +10 -3
- data/lib/arrow/raw-tensor-converter.rb +89 -0
- data/lib/arrow/record-batch-file-reader.rb +2 -0
- data/lib/arrow/record-batch-stream-reader.rb +2 -0
- data/lib/arrow/record-batch.rb +6 -2
- data/{test/fixture/null-without-double-quote.csv → lib/arrow/ruby.rb} +5 -4
- data/lib/arrow/scalar.rb +67 -0
- data/lib/arrow/slicer.rb +61 -0
- data/lib/arrow/sort-key.rb +3 -3
- data/lib/arrow/sparse-union-array-builder.rb +56 -0
- data/lib/arrow/sparse-union-array.rb +26 -0
- data/lib/arrow/stream-decoder.rb +29 -0
- data/{test/test-decimal256-data-type.rb → lib/arrow/stream-listener.rb} +25 -9
- data/lib/arrow/string-array-builder.rb +30 -0
- data/lib/arrow/struct-array-builder.rb +0 -5
- data/lib/arrow/table-formatter.rb +38 -8
- data/lib/arrow/table-list-formatter.rb +3 -3
- data/lib/arrow/table-loader.rb +11 -5
- data/lib/arrow/table-saver.rb +4 -3
- data/lib/arrow/table-table-formatter.rb +7 -0
- data/lib/arrow/table.rb +180 -33
- data/lib/arrow/tensor.rb +144 -0
- data/lib/arrow/time-unit.rb +31 -0
- data/lib/arrow/time32-array-builder.rb +2 -14
- data/lib/arrow/time32-data-type.rb +9 -38
- data/lib/arrow/time64-array-builder.rb +2 -14
- data/lib/arrow/time64-data-type.rb +9 -38
- data/lib/arrow/timestamp-array-builder.rb +3 -15
- data/lib/arrow/timestamp-data-type.rb +9 -34
- data/{test/test-date64-array.rb → lib/arrow/timestamp-parser.rb} +14 -6
- data/lib/arrow/union-array-builder.rb +59 -0
- data/lib/arrow/union-array.rb +26 -0
- data/lib/arrow/version.rb +1 -1
- data/lib/arrow.rb +2 -7
- data/red-arrow.gemspec +74 -11
- metadata +85 -210
- data/test/fixture/TestOrcFile.test1.orc +0 -0
- data/test/fixture/with-header-float.csv +0 -20
- data/test/fixture/with-header.csv +0 -20
- data/test/fixture/without-header-float.csv +0 -19
- data/test/fixture/without-header.csv +0 -19
- data/test/helper/omittable.rb +0 -36
- data/test/helper.rb +0 -30
- data/test/raw-records/test-basic-arrays.rb +0 -395
- data/test/raw-records/test-dense-union-array.rb +0 -521
- data/test/raw-records/test-list-array.rb +0 -610
- data/test/raw-records/test-map-array.rb +0 -478
- data/test/raw-records/test-multiple-columns.rb +0 -65
- data/test/raw-records/test-sparse-union-array.rb +0 -511
- data/test/raw-records/test-struct-array.rb +0 -515
- data/test/raw-records/test-table.rb +0 -47
- data/test/run-test.rb +0 -71
- data/test/test-array-builder.rb +0 -136
- data/test/test-array.rb +0 -325
- data/test/test-bigdecimal.rb +0 -40
- data/test/test-binary-dictionary-array-builder.rb +0 -103
- data/test/test-chunked-array.rb +0 -183
- data/test/test-column.rb +0 -92
- data/test/test-csv-loader.rb +0 -250
- data/test/test-data-type.rb +0 -83
- data/test/test-decimal128-array-builder.rb +0 -112
- data/test/test-decimal128-data-type.rb +0 -31
- data/test/test-decimal128.rb +0 -102
- data/test/test-decimal256-array-builder.rb +0 -112
- data/test/test-decimal256-array.rb +0 -38
- data/test/test-decimal256.rb +0 -102
- data/test/test-dense-union-data-type.rb +0 -41
- data/test/test-dictionary-data-type.rb +0 -40
- data/test/test-expression.rb +0 -40
- data/test/test-feather.rb +0 -49
- data/test/test-field.rb +0 -91
- data/test/test-file-output-stream.rb +0 -54
- data/test/test-fixed-size-binary-array-builder.rb +0 -92
- data/test/test-fixed-size-binary-array.rb +0 -36
- data/test/test-function.rb +0 -210
- data/test/test-group.rb +0 -180
- data/test/test-list-array-builder.rb +0 -79
- data/test/test-list-array.rb +0 -32
- data/test/test-list-data-type.rb +0 -69
- data/test/test-map-array-builder.rb +0 -110
- data/test/test-map-array.rb +0 -33
- data/test/test-memory-view.rb +0 -434
- data/test/test-orc.rb +0 -173
- data/test/test-record-batch-builder.rb +0 -125
- data/test/test-record-batch-file-reader.rb +0 -115
- data/test/test-record-batch-iterator.rb +0 -37
- data/test/test-record-batch-reader.rb +0 -46
- data/test/test-record-batch.rb +0 -182
- data/test/test-schema.rb +0 -134
- data/test/test-slicer.rb +0 -487
- data/test/test-sort-indices.rb +0 -40
- data/test/test-sort-key.rb +0 -81
- data/test/test-sort-options.rb +0 -58
- data/test/test-sparse-union-data-type.rb +0 -41
- data/test/test-string-dictionary-array-builder.rb +0 -103
- data/test/test-struct-array-builder.rb +0 -184
- data/test/test-struct-array.rb +0 -94
- data/test/test-struct-data-type.rb +0 -112
- data/test/test-table.rb +0 -1123
- data/test/test-time.rb +0 -288
- data/test/test-time32-array.rb +0 -81
- data/test/test-time64-array.rb +0 -81
- data/test/test-time64-data-type.rb +0 -42
- data/test/test-timestamp-array.rb +0 -45
- data/test/test-timestamp-data-type.rb +0 -42
- data/test/values/test-basic-arrays.rb +0 -325
- data/test/values/test-dense-union-array.rb +0 -509
- data/test/values/test-dictionary-array.rb +0 -295
- data/test/values/test-list-array.rb +0 -571
- data/test/values/test-map-array.rb +0 -466
- data/test/values/test-sparse-union-array.rb +0 -500
- data/test/values/test-struct-array.rb +0 -512
|
@@ -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 Arrow
|
|
19
|
+
class Decimal128
|
|
20
|
+
def abs
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def negate
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -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 Arrow
|
|
19
|
+
class Decimal256
|
|
20
|
+
def abs
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def negate
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
|
|
18
|
+
module Arrow
|
|
19
|
+
class Error < StandardError
|
|
20
|
+
class Invalid < Error
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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 FileSystem
|
|
20
|
+
def open_output_stream(path)
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
module Arrow
|
|
19
|
+
class Function
|
|
20
|
+
def execute(args, options=nil, context=nil)
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
22
23
|
end
|
|
23
24
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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 RecordBatchIterator
|
|
20
|
+
def to_list
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
|
|
18
|
+
module Arrow
|
|
19
|
+
class RecordBatch
|
|
20
|
+
def n_rows
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
|
|
18
|
+
module Arrow
|
|
19
|
+
class SortKey
|
|
20
|
+
def target
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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 SortOptions
|
|
20
|
+
def add_sort_key(target, order=nil)
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
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 StreamListenerRaw
|
|
20
|
+
class << self
|
|
21
|
+
def type_register
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
module Arrow
|
|
19
|
+
class Table
|
|
20
|
+
def filter(filter, options=nil)
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
20
23
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
def take(indices)
|
|
25
|
+
raise NotImplementedError
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def n_rows
|
|
29
|
+
raise NotImplementedError
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def slice(from, length)
|
|
33
|
+
raise NotImplementedError
|
|
34
|
+
end
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
null,
|
|
32
|
-
-3,
|
|
33
|
-
null,
|
|
34
|
-
null,
|
|
35
|
-
2,
|
|
36
|
-
-3
|
|
37
|
-
]
|
|
38
|
-
ARRAY
|
|
36
|
+
def remove_column(index)
|
|
37
|
+
raise NotImplementedError
|
|
38
|
+
end
|
|
39
39
|
end
|
|
40
40
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
module Writable
|
|
20
|
+
def write(data)
|
|
21
|
+
raise NotImplementedError
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
data/lib/arrow/jruby.rb
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
if File.exist?("../red-arrow_jars")
|
|
19
|
+
# installed gems
|
|
20
|
+
require_relative "../red-arrow_jars"
|
|
21
|
+
else
|
|
22
|
+
# local development
|
|
23
|
+
require "red-arrow_jars"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
module Arrow
|
|
27
|
+
class << self
|
|
28
|
+
def allocator
|
|
29
|
+
@allocator ||= org.apache.arrow.memory.RootAllocator.new
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
require_relative "jruby/array"
|
|
35
|
+
require_relative "jruby/array-builder"
|
|
36
|
+
require_relative "jruby/chunked-array"
|
|
37
|
+
require_relative "jruby/compression-type"
|
|
38
|
+
require_relative "jruby/csv-read-options"
|
|
39
|
+
require_relative "jruby/decimal128"
|
|
40
|
+
require_relative "jruby/decimal256"
|
|
41
|
+
require_relative "jruby/error"
|
|
42
|
+
require_relative "jruby/file-system"
|
|
43
|
+
require_relative "jruby/function"
|
|
44
|
+
require_relative "jruby/record-batch"
|
|
45
|
+
require_relative "jruby/record-batch-iterator"
|
|
46
|
+
require_relative "jruby/sort-key"
|
|
47
|
+
require_relative "jruby/sort-options"
|
|
48
|
+
require_relative "jruby/stream-listener-raw"
|
|
49
|
+
require_relative "jruby/table"
|
|
50
|
+
require_relative "jruby/writable"
|
|
51
|
+
|
|
52
|
+
require_relative "libraries"
|
|
@@ -15,10 +15,15 @@
|
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
module Arrow
|
|
19
|
+
class LargeListArrayBuilder
|
|
20
|
+
class << self
|
|
21
|
+
def build(data_type, values)
|
|
22
|
+
builder = new(data_type)
|
|
23
|
+
builder.build(values)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
prepend ListValuesAppendable
|
|
23
28
|
end
|
|
24
29
|
end
|
|
@@ -0,0 +1,83 @@
|
|
|
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 LargeListDataType
|
|
20
|
+
include ListFieldResolvable
|
|
21
|
+
|
|
22
|
+
alias_method :initialize_raw, :initialize
|
|
23
|
+
private :initialize_raw
|
|
24
|
+
|
|
25
|
+
# Creates a new {Arrow::LargeListDataType}.
|
|
26
|
+
#
|
|
27
|
+
# @overload initialize(field)
|
|
28
|
+
#
|
|
29
|
+
# @param field [Arrow::Field, Hash] The field of the large list
|
|
30
|
+
# data type. You can also specify field description by `Hash`.
|
|
31
|
+
#
|
|
32
|
+
# See {Arrow::Field.new} how to specify field description.
|
|
33
|
+
#
|
|
34
|
+
# @example Create a large list data type with {Arrow::Field}
|
|
35
|
+
# visible_field = Arrow::Field.new("visible", :boolean)
|
|
36
|
+
# Arrow::LargeListDataType.new(visible_field)
|
|
37
|
+
#
|
|
38
|
+
# @example Create a large list data type with field description
|
|
39
|
+
# Arrow::LargeListDataType.new(name: "visible", type: :boolean)
|
|
40
|
+
#
|
|
41
|
+
# @overload initialize(description)
|
|
42
|
+
#
|
|
43
|
+
# @param description [Hash] The description of the large list data
|
|
44
|
+
# type. It must have `:field` value.
|
|
45
|
+
#
|
|
46
|
+
# @option description [Arrow::Field, Hash] :field The field of
|
|
47
|
+
# the large list data type. You can also specify field
|
|
48
|
+
# description by `Hash`.
|
|
49
|
+
#
|
|
50
|
+
# See {Arrow::Field.new} how to specify field description.
|
|
51
|
+
#
|
|
52
|
+
# @example Create a large list data type with {Arrow::Field}
|
|
53
|
+
# visible_field = Arrow::Field.new("visible", :boolean)
|
|
54
|
+
# Arrow::LargeListDataType.new(field: visible_field)
|
|
55
|
+
#
|
|
56
|
+
# @example Create a large list data type with field description
|
|
57
|
+
# Arrow::LargeListDataType.new(field: {name: "visible", type: :boolean})
|
|
58
|
+
#
|
|
59
|
+
# @overload initialize(data_type)
|
|
60
|
+
#
|
|
61
|
+
# @param data_type [Arrow::DataType, String, Symbol,
|
|
62
|
+
# ::Array<String>, ::Array<Symbol>, Hash] The element data
|
|
63
|
+
# type of the large list data type. A field is created with the
|
|
64
|
+
# default name `"item"` from the data type automatically.
|
|
65
|
+
#
|
|
66
|
+
# See {Arrow::DataType.resolve} how to specify data type.
|
|
67
|
+
#
|
|
68
|
+
# @example Create a large list data type with {Arrow::DataType}
|
|
69
|
+
# Arrow::LargeListDataType.new(Arrow::BooleanDataType.new)
|
|
70
|
+
#
|
|
71
|
+
# @example Create a large list data type with data type name as String
|
|
72
|
+
# Arrow::LargeListDataType.new("boolean")
|
|
73
|
+
#
|
|
74
|
+
# @example Create a large list data type with data type name as Symbol
|
|
75
|
+
# Arrow::LargeListDataType.new(:boolean)
|
|
76
|
+
#
|
|
77
|
+
# @example Create a large list data type with data type as Array
|
|
78
|
+
# Arrow::LargeListDataType.new([:time32, :milli])
|
|
79
|
+
def initialize(arg)
|
|
80
|
+
initialize_raw(resolve_field(arg))
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
require_relative "array-computable"
|
|
19
|
+
require_relative "column-containable"
|
|
20
|
+
require_relative "field-containable"
|
|
21
|
+
require_relative "generic-filterable"
|
|
22
|
+
require_relative "generic-takeable"
|
|
23
|
+
require_relative "input-referable"
|
|
24
|
+
require_relative "list-field-resolvable"
|
|
25
|
+
require_relative "list-values-appendable"
|
|
26
|
+
require_relative "record-containable"
|
|
27
|
+
require_relative "symbol-values-appendable"
|
|
28
|
+
|
|
29
|
+
require_relative "aggregate-node-options"
|
|
30
|
+
require_relative "aggregation"
|
|
31
|
+
require_relative "array"
|
|
32
|
+
require_relative "array-builder"
|
|
33
|
+
require_relative "array-statistics"
|
|
34
|
+
require_relative "bigdecimal-extension"
|
|
35
|
+
require_relative "binary-dictionary-array-builder"
|
|
36
|
+
require_relative "buffer"
|
|
37
|
+
require_relative "chunked-array"
|
|
38
|
+
require_relative "column"
|
|
39
|
+
require_relative "compression-type"
|
|
40
|
+
require_relative "csv-loader"
|
|
41
|
+
require_relative "csv-read-options"
|
|
42
|
+
require_relative "csv-write-options"
|
|
43
|
+
require_relative "data-type"
|
|
44
|
+
require_relative "date32-array"
|
|
45
|
+
require_relative "date32-array-builder"
|
|
46
|
+
require_relative "date64-array"
|
|
47
|
+
require_relative "date64-array-builder"
|
|
48
|
+
require_relative "datum"
|
|
49
|
+
require_relative "day-time-interval-array-builder"
|
|
50
|
+
require_relative "decimal128"
|
|
51
|
+
require_relative "decimal128-array"
|
|
52
|
+
require_relative "decimal128-array-builder"
|
|
53
|
+
require_relative "decimal128-data-type"
|
|
54
|
+
require_relative "decimal256"
|
|
55
|
+
require_relative "decimal256-array"
|
|
56
|
+
require_relative "decimal256-array-builder"
|
|
57
|
+
require_relative "decimal256-data-type"
|
|
58
|
+
require_relative "dense-union-array"
|
|
59
|
+
require_relative "dense-union-array-builder"
|
|
60
|
+
require_relative "dense-union-data-type"
|
|
61
|
+
require_relative "dictionary-array"
|
|
62
|
+
require_relative "dictionary-data-type"
|
|
63
|
+
require_relative "duration-array"
|
|
64
|
+
require_relative "duration-array-builder"
|
|
65
|
+
require_relative "duration-data-type"
|
|
66
|
+
require_relative "equal-options"
|
|
67
|
+
require_relative "expression"
|
|
68
|
+
require_relative "field"
|
|
69
|
+
require_relative "file-output-stream"
|
|
70
|
+
require_relative "file-system"
|
|
71
|
+
require_relative "fixed-size-binary-array"
|
|
72
|
+
require_relative "fixed-size-binary-array-builder"
|
|
73
|
+
require_relative "fixed-size-list-array-builder"
|
|
74
|
+
require_relative "fixed-size-list-data-type"
|
|
75
|
+
require_relative "function"
|
|
76
|
+
require_relative "group"
|
|
77
|
+
require_relative "half-float"
|
|
78
|
+
require_relative "half-float-array"
|
|
79
|
+
require_relative "half-float-array-builder"
|
|
80
|
+
require_relative "large-list-array-builder"
|
|
81
|
+
require_relative "large-list-data-type"
|
|
82
|
+
require_relative "list-array-builder"
|
|
83
|
+
require_relative "list-data-type"
|
|
84
|
+
require_relative "list-slice-options"
|
|
85
|
+
require_relative "make-struct-options"
|
|
86
|
+
require_relative "map-array"
|
|
87
|
+
require_relative "map-array-builder"
|
|
88
|
+
require_relative "map-data-type"
|
|
89
|
+
require_relative "month-day-nano-interval-array-builder"
|
|
90
|
+
require_relative "null-array"
|
|
91
|
+
require_relative "null-array-builder"
|
|
92
|
+
require_relative "path-extension"
|
|
93
|
+
require_relative "record"
|
|
94
|
+
require_relative "record-batch"
|
|
95
|
+
require_relative "record-batch-builder"
|
|
96
|
+
require_relative "record-batch-file-reader"
|
|
97
|
+
require_relative "record-batch-iterator"
|
|
98
|
+
require_relative "record-batch-reader"
|
|
99
|
+
require_relative "record-batch-stream-reader"
|
|
100
|
+
require_relative "rolling-window"
|
|
101
|
+
require_relative "s3-global-options"
|
|
102
|
+
require_relative "scalar"
|
|
103
|
+
require_relative "schema"
|
|
104
|
+
require_relative "slicer"
|
|
105
|
+
require_relative "sort-key"
|
|
106
|
+
require_relative "sort-options"
|
|
107
|
+
require_relative "source-node-options"
|
|
108
|
+
require_relative "sparse-union-array"
|
|
109
|
+
require_relative "sparse-union-array-builder"
|
|
110
|
+
require_relative "sparse-union-data-type"
|
|
111
|
+
require_relative "string-dictionary-array-builder"
|
|
112
|
+
require_relative "string-array-builder"
|
|
113
|
+
require_relative "stream-decoder"
|
|
114
|
+
require_relative "stream-listener"
|
|
115
|
+
require_relative "struct-array"
|
|
116
|
+
require_relative "struct-array-builder"
|
|
117
|
+
require_relative "struct-data-type"
|
|
118
|
+
require_relative "table"
|
|
119
|
+
require_relative "table-concatenate-options"
|
|
120
|
+
require_relative "table-formatter"
|
|
121
|
+
require_relative "table-list-formatter"
|
|
122
|
+
require_relative "table-table-formatter"
|
|
123
|
+
require_relative "table-loader"
|
|
124
|
+
require_relative "table-saver"
|
|
125
|
+
require_relative "tensor"
|
|
126
|
+
require_relative "time"
|
|
127
|
+
require_relative "time-unit"
|
|
128
|
+
require_relative "time32-array"
|
|
129
|
+
require_relative "time32-array-builder"
|
|
130
|
+
require_relative "time32-data-type"
|
|
131
|
+
require_relative "time64-array"
|
|
132
|
+
require_relative "time64-array-builder"
|
|
133
|
+
require_relative "time64-data-type"
|
|
134
|
+
require_relative "timestamp-array"
|
|
135
|
+
require_relative "timestamp-array-builder"
|
|
136
|
+
require_relative "timestamp-data-type"
|
|
137
|
+
require_relative "timestamp-parser"
|
|
138
|
+
require_relative "union-array"
|
|
139
|
+
require_relative "union-array-builder"
|
|
140
|
+
require_relative "writable"
|
|
@@ -24,73 +24,6 @@ module Arrow
|
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
# @overload append_value
|
|
30
|
-
#
|
|
31
|
-
# Starts appending a list record. You also need to append list
|
|
32
|
-
# value by {#value_builder}.
|
|
33
|
-
#
|
|
34
|
-
# @overload append_value(list)
|
|
35
|
-
#
|
|
36
|
-
# Appends a list record including list value.
|
|
37
|
-
#
|
|
38
|
-
# @param value [nil, ::Array] The list value of the record.
|
|
39
|
-
#
|
|
40
|
-
# If this is `nil`, the list record is null.
|
|
41
|
-
#
|
|
42
|
-
# If this is `Array`, it's the list value of the record.
|
|
43
|
-
#
|
|
44
|
-
# @since 0.12.0
|
|
45
|
-
def append_value(*args)
|
|
46
|
-
n_args = args.size
|
|
47
|
-
|
|
48
|
-
case n_args
|
|
49
|
-
when 0
|
|
50
|
-
append_value_raw
|
|
51
|
-
when 1
|
|
52
|
-
value = args[0]
|
|
53
|
-
case value
|
|
54
|
-
when nil
|
|
55
|
-
append_null
|
|
56
|
-
when ::Array
|
|
57
|
-
append_value_raw
|
|
58
|
-
@value_builder ||= value_builder
|
|
59
|
-
@value_builder.append(*value)
|
|
60
|
-
else
|
|
61
|
-
message = "list value must be nil or Array: #{value.inspect}"
|
|
62
|
-
raise ArgumentError, message
|
|
63
|
-
end
|
|
64
|
-
else
|
|
65
|
-
message = "wrong number of arguments (given #{n_args}, expected 0..1)"
|
|
66
|
-
raise ArgumentError, message
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def append_values(lists, is_valids=nil)
|
|
71
|
-
if is_valids
|
|
72
|
-
is_valids.each_with_index do |is_valid, i|
|
|
73
|
-
if is_valid
|
|
74
|
-
append_value(lists[i])
|
|
75
|
-
else
|
|
76
|
-
append_null
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
else
|
|
80
|
-
lists.each do |list|
|
|
81
|
-
append_value(list)
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
# @since 0.12.0
|
|
87
|
-
def append(*values)
|
|
88
|
-
if values.empty?
|
|
89
|
-
# For backward compatibility
|
|
90
|
-
append_value
|
|
91
|
-
else
|
|
92
|
-
super
|
|
93
|
-
end
|
|
94
|
-
end
|
|
27
|
+
prepend ListValuesAppendable
|
|
95
28
|
end
|
|
96
29
|
end
|