red-arrow 18.1.0 → 19.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/lib/arrow/array.rb +7 -4
  3. data/lib/arrow/column.rb +4 -4
  4. data/lib/arrow/jruby/array-builder.rb +114 -0
  5. data/lib/arrow/jruby/array.rb +109 -0
  6. data/{test/helper/fixture.rb → lib/arrow/jruby/chunked-array.rb} +14 -6
  7. data/lib/arrow/jruby/compression-type.rb +26 -0
  8. data/{test/test-boolean-scalar.rb → lib/arrow/jruby/csv-read-options.rb} +12 -6
  9. data/{test/test-map-data-type.rb → lib/arrow/jruby/data-type.rb} +24 -12
  10. data/lib/arrow/jruby/decimal128.rb +28 -0
  11. data/lib/arrow/jruby/decimal256.rb +28 -0
  12. data/{test/fixture/null-with-double-quote.csv → lib/arrow/jruby/error.rb} +7 -4
  13. data/lib/arrow/jruby/file-system.rb +24 -0
  14. data/{test/test-null-array.rb → lib/arrow/jruby/function.rb} +5 -4
  15. data/lib/arrow/jruby/record-batch-iterator.rb +24 -0
  16. data/{test/fixture/integer-float.csv → lib/arrow/jruby/record-batch.rb} +8 -4
  17. data/{test/fixture/float-integer.csv → lib/arrow/jruby/sort-key.rb} +8 -4
  18. data/lib/arrow/jruby/sort-options.rb +24 -0
  19. data/lib/arrow/jruby/stream-listener-raw.rb +25 -0
  20. data/{test/test-rolling-window.rb → lib/arrow/jruby/table.rb} +19 -19
  21. data/lib/arrow/jruby/writable.rb +24 -0
  22. data/lib/arrow/jruby.rb +52 -0
  23. data/lib/arrow/libraries.rb +126 -0
  24. data/lib/arrow/list-array-builder.rb +1 -0
  25. data/lib/arrow/loader.rb +3 -111
  26. data/{test/fixture/null-without-double-quote.csv → lib/arrow/ruby.rb} +6 -4
  27. data/lib/arrow/version.rb +1 -1
  28. data/lib/arrow.rb +2 -7
  29. data/red-arrow.gemspec +15 -6
  30. metadata +26 -229
  31. data/test/each-raw-record/test-basic-arrays.rb +0 -411
  32. data/test/each-raw-record/test-dense-union-array.rb +0 -566
  33. data/test/each-raw-record/test-dictionary-array.rb +0 -341
  34. data/test/each-raw-record/test-list-array.rb +0 -628
  35. data/test/each-raw-record/test-map-array.rb +0 -507
  36. data/test/each-raw-record/test-multiple-columns.rb +0 -72
  37. data/test/each-raw-record/test-sparse-union-array.rb +0 -528
  38. data/test/each-raw-record/test-struct-array.rb +0 -529
  39. data/test/each-raw-record/test-table.rb +0 -47
  40. data/test/fixture/TestOrcFile.test1.orc +0 -0
  41. data/test/fixture/with-header-float.csv +0 -20
  42. data/test/fixture/with-header.csv +0 -20
  43. data/test/fixture/without-header-float.csv +0 -19
  44. data/test/fixture/without-header.csv +0 -19
  45. data/test/helper/omittable.rb +0 -49
  46. data/test/helper.rb +0 -31
  47. data/test/raw-records/test-basic-arrays.rb +0 -405
  48. data/test/raw-records/test-dense-union-array.rb +0 -566
  49. data/test/raw-records/test-dictionary-array.rb +0 -341
  50. data/test/raw-records/test-list-array.rb +0 -628
  51. data/test/raw-records/test-map-array.rb +0 -507
  52. data/test/raw-records/test-multiple-columns.rb +0 -65
  53. data/test/raw-records/test-sparse-union-array.rb +0 -556
  54. data/test/raw-records/test-struct-array.rb +0 -529
  55. data/test/raw-records/test-table.rb +0 -47
  56. data/test/run-test.rb +0 -71
  57. data/test/test-array-builder.rb +0 -198
  58. data/test/test-array.rb +0 -332
  59. data/test/test-bigdecimal.rb +0 -40
  60. data/test/test-binary-dictionary-array-builder.rb +0 -103
  61. data/test/test-buffer.rb +0 -49
  62. data/test/test-chunked-array.rb +0 -198
  63. data/test/test-column.rb +0 -123
  64. data/test/test-csv-loader.rb +0 -297
  65. data/test/test-data-type.rb +0 -84
  66. data/test/test-date32-array.rb +0 -24
  67. data/test/test-date64-array.rb +0 -25
  68. data/test/test-decimal128-array-builder.rb +0 -126
  69. data/test/test-decimal128-array.rb +0 -47
  70. data/test/test-decimal128-data-type.rb +0 -31
  71. data/test/test-decimal128.rb +0 -126
  72. data/test/test-decimal256-array-builder.rb +0 -126
  73. data/test/test-decimal256-array.rb +0 -47
  74. data/test/test-decimal256-data-type.rb +0 -31
  75. data/test/test-decimal256.rb +0 -126
  76. data/test/test-dense-union-array.rb +0 -42
  77. data/test/test-dense-union-data-type.rb +0 -41
  78. data/test/test-dictionary-array.rb +0 -41
  79. data/test/test-dictionary-data-type.rb +0 -40
  80. data/test/test-expression.rb +0 -51
  81. data/test/test-feather.rb +0 -49
  82. data/test/test-field.rb +0 -117
  83. data/test/test-file-output-stream.rb +0 -54
  84. data/test/test-fixed-size-binary-array-builder.rb +0 -92
  85. data/test/test-fixed-size-binary-array.rb +0 -36
  86. data/test/test-float-scalar.rb +0 -46
  87. data/test/test-function.rb +0 -210
  88. data/test/test-group.rb +0 -193
  89. data/test/test-half-float-array.rb +0 -43
  90. data/test/test-half-float.rb +0 -130
  91. data/test/test-list-array-builder.rb +0 -79
  92. data/test/test-list-array.rb +0 -32
  93. data/test/test-list-data-type.rb +0 -69
  94. data/test/test-map-array-builder.rb +0 -110
  95. data/test/test-map-array.rb +0 -33
  96. data/test/test-memory-view.rb +0 -434
  97. data/test/test-orc.rb +0 -173
  98. data/test/test-ractor.rb +0 -34
  99. data/test/test-record-batch-builder.rb +0 -125
  100. data/test/test-record-batch-file-reader.rb +0 -136
  101. data/test/test-record-batch-iterator.rb +0 -37
  102. data/test/test-record-batch-reader.rb +0 -46
  103. data/test/test-record-batch-stream-reader.rb +0 -129
  104. data/test/test-record-batch.rb +0 -182
  105. data/test/test-scalar.rb +0 -65
  106. data/test/test-schema.rb +0 -134
  107. data/test/test-slicer.rb +0 -589
  108. data/test/test-sort-indices.rb +0 -40
  109. data/test/test-sort-key.rb +0 -81
  110. data/test/test-sort-options.rb +0 -58
  111. data/test/test-sparse-union-array.rb +0 -38
  112. data/test/test-sparse-union-data-type.rb +0 -41
  113. data/test/test-stream-listener.rb +0 -60
  114. data/test/test-string-dictionary-array-builder.rb +0 -103
  115. data/test/test-struct-array-builder.rb +0 -184
  116. data/test/test-struct-array.rb +0 -94
  117. data/test/test-struct-data-type.rb +0 -112
  118. data/test/test-table.rb +0 -1530
  119. data/test/test-tensor.rb +0 -297
  120. data/test/test-time.rb +0 -288
  121. data/test/test-time32-array.rb +0 -81
  122. data/test/test-time32-data-type.rb +0 -42
  123. data/test/test-time64-array.rb +0 -81
  124. data/test/test-time64-data-type.rb +0 -42
  125. data/test/test-timestamp-array.rb +0 -45
  126. data/test/test-timestamp-data-type.rb +0 -42
  127. data/test/values/test-basic-arrays.rb +0 -335
  128. data/test/values/test-dense-union-array.rb +0 -552
  129. data/test/values/test-dictionary-array.rb +0 -325
  130. data/test/values/test-list-array.rb +0 -587
  131. data/test/values/test-map-array.rb +0 -489
  132. data/test/values/test-sparse-union-array.rb +0 -543
  133. data/test/values/test-struct-array.rb +0 -524
@@ -15,26 +15,26 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- class RollingWindowTest < Test::Unit::TestCase
19
- include Helper::Fixture
18
+ module Arrow
19
+ class Table
20
+ def filter(filter, options=nil)
21
+ raise NotImplementedError
22
+ end
20
23
 
21
- def setup
22
- raw_table = {
23
- :number => Arrow::Int32Array.new([1, -2, nil, 4, 6, 3]),
24
- }
25
- @table = Arrow::Table.new(raw_table)
26
- end
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
- test("#lag") do
29
- assert_equal(<<-ARRAY.chomp, @table.window.lag(:number).to_s)
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
@@ -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"
@@ -0,0 +1,126 @@
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 "record-containable"
25
+ require_relative "symbol-values-appendable"
26
+
27
+ require_relative "aggregate-node-options"
28
+ require_relative "aggregation"
29
+ require_relative "array"
30
+ require_relative "array-builder"
31
+ require_relative "bigdecimal-extension"
32
+ require_relative "binary-dictionary-array-builder"
33
+ require_relative "buffer"
34
+ require_relative "chunked-array"
35
+ require_relative "column"
36
+ require_relative "compression-type"
37
+ require_relative "csv-loader"
38
+ require_relative "csv-read-options"
39
+ require_relative "data-type"
40
+ require_relative "date32-array"
41
+ require_relative "date32-array-builder"
42
+ require_relative "date64-array"
43
+ require_relative "date64-array-builder"
44
+ require_relative "datum"
45
+ require_relative "day-time-interval-array-builder"
46
+ require_relative "decimal128"
47
+ require_relative "decimal128-array"
48
+ require_relative "decimal128-array-builder"
49
+ require_relative "decimal128-data-type"
50
+ require_relative "decimal256"
51
+ require_relative "decimal256-array"
52
+ require_relative "decimal256-array-builder"
53
+ require_relative "decimal256-data-type"
54
+ require_relative "dense-union-array"
55
+ require_relative "dense-union-array-builder"
56
+ require_relative "dense-union-data-type"
57
+ require_relative "dictionary-array"
58
+ require_relative "dictionary-data-type"
59
+ require_relative "equal-options"
60
+ require_relative "expression"
61
+ require_relative "field"
62
+ require_relative "file-output-stream"
63
+ require_relative "file-system"
64
+ require_relative "fixed-size-binary-array"
65
+ require_relative "fixed-size-binary-array-builder"
66
+ require_relative "function"
67
+ require_relative "group"
68
+ require_relative "half-float"
69
+ require_relative "half-float-array"
70
+ require_relative "half-float-array-builder"
71
+ require_relative "list-array-builder"
72
+ require_relative "list-data-type"
73
+ require_relative "map-array"
74
+ require_relative "map-array-builder"
75
+ require_relative "map-data-type"
76
+ require_relative "month-day-nano-interval-array-builder"
77
+ require_relative "null-array"
78
+ require_relative "null-array-builder"
79
+ require_relative "path-extension"
80
+ require_relative "record"
81
+ require_relative "record-batch"
82
+ require_relative "record-batch-builder"
83
+ require_relative "record-batch-file-reader"
84
+ require_relative "record-batch-iterator"
85
+ require_relative "record-batch-reader"
86
+ require_relative "record-batch-stream-reader"
87
+ require_relative "rolling-window"
88
+ require_relative "s3-global-options"
89
+ require_relative "scalar"
90
+ require_relative "schema"
91
+ require_relative "slicer"
92
+ require_relative "sort-key"
93
+ require_relative "sort-options"
94
+ require_relative "source-node-options"
95
+ require_relative "sparse-union-array"
96
+ require_relative "sparse-union-array-builder"
97
+ require_relative "sparse-union-data-type"
98
+ require_relative "string-dictionary-array-builder"
99
+ require_relative "string-array-builder"
100
+ require_relative "stream-decoder"
101
+ require_relative "stream-listener"
102
+ require_relative "struct-array"
103
+ require_relative "struct-array-builder"
104
+ require_relative "struct-data-type"
105
+ require_relative "table"
106
+ require_relative "table-concatenate-options"
107
+ require_relative "table-formatter"
108
+ require_relative "table-list-formatter"
109
+ require_relative "table-table-formatter"
110
+ require_relative "table-loader"
111
+ require_relative "table-saver"
112
+ require_relative "tensor"
113
+ require_relative "time"
114
+ require_relative "time-unit"
115
+ require_relative "time32-array"
116
+ require_relative "time32-array-builder"
117
+ require_relative "time32-data-type"
118
+ require_relative "time64-array"
119
+ require_relative "time64-array-builder"
120
+ require_relative "time64-data-type"
121
+ require_relative "timestamp-array"
122
+ require_relative "timestamp-array-builder"
123
+ require_relative "timestamp-data-type"
124
+ require_relative "timestamp-parser"
125
+ require_relative "union-array-builder"
126
+ require_relative "writable"
@@ -55,6 +55,7 @@ module Arrow
55
55
  append_null
56
56
  when ::Array
57
57
  append_value_raw
58
+ return if value.empty?
58
59
  @value_builder ||= value_builder
59
60
  @value_builder.append(*value)
60
61
  else
data/lib/arrow/loader.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- require "arrow/block-closable"
18
+ require_relative "block-closable"
19
19
 
20
20
  module Arrow
21
21
  class Loader < GObjectIntrospection::Loader
@@ -34,115 +34,7 @@ module Arrow
34
34
  end
35
35
 
36
36
  def require_libraries
37
- require "arrow/array-computable"
38
- require "arrow/column-containable"
39
- require "arrow/field-containable"
40
- require "arrow/generic-filterable"
41
- require "arrow/generic-takeable"
42
- require "arrow/input-referable"
43
- require "arrow/record-containable"
44
- require "arrow/symbol-values-appendable"
45
-
46
- require "arrow/aggregate-node-options"
47
- require "arrow/aggregation"
48
- require "arrow/array"
49
- require "arrow/array-builder"
50
- require "arrow/bigdecimal-extension"
51
- require "arrow/binary-dictionary-array-builder"
52
- require "arrow/buffer"
53
- require "arrow/chunked-array"
54
- require "arrow/column"
55
- require "arrow/compression-type"
56
- require "arrow/csv-loader"
57
- require "arrow/csv-read-options"
58
- require "arrow/data-type"
59
- require "arrow/date32-array"
60
- require "arrow/date32-array-builder"
61
- require "arrow/date64-array"
62
- require "arrow/date64-array-builder"
63
- require "arrow/datum"
64
- require "arrow/day-time-interval-array-builder"
65
- require "arrow/decimal128"
66
- require "arrow/decimal128-array"
67
- require "arrow/decimal128-array-builder"
68
- require "arrow/decimal128-data-type"
69
- require "arrow/decimal256"
70
- require "arrow/decimal256-array"
71
- require "arrow/decimal256-array-builder"
72
- require "arrow/decimal256-data-type"
73
- require "arrow/dense-union-array"
74
- require "arrow/dense-union-array-builder"
75
- require "arrow/dense-union-data-type"
76
- require "arrow/dictionary-array"
77
- require "arrow/dictionary-data-type"
78
- require "arrow/equal-options"
79
- require "arrow/expression"
80
- require "arrow/field"
81
- require "arrow/file-output-stream"
82
- require "arrow/file-system"
83
- require "arrow/fixed-size-binary-array"
84
- require "arrow/fixed-size-binary-array-builder"
85
- require "arrow/function"
86
- require "arrow/group"
87
- require "arrow/half-float"
88
- require "arrow/half-float-array"
89
- require "arrow/half-float-array-builder"
90
- require "arrow/list-array-builder"
91
- require "arrow/list-data-type"
92
- require "arrow/map-array"
93
- require "arrow/map-array-builder"
94
- require "arrow/map-data-type"
95
- require "arrow/month-day-nano-interval-array-builder"
96
- require "arrow/null-array"
97
- require "arrow/null-array-builder"
98
- require "arrow/path-extension"
99
- require "arrow/record"
100
- require "arrow/record-batch"
101
- require "arrow/record-batch-builder"
102
- require "arrow/record-batch-file-reader"
103
- require "arrow/record-batch-iterator"
104
- require "arrow/record-batch-reader"
105
- require "arrow/record-batch-stream-reader"
106
- require "arrow/rolling-window"
107
- require "arrow/s3-global-options"
108
- require "arrow/scalar"
109
- require "arrow/schema"
110
- require "arrow/slicer"
111
- require "arrow/sort-key"
112
- require "arrow/sort-options"
113
- require "arrow/source-node-options"
114
- require "arrow/sparse-union-array"
115
- require "arrow/sparse-union-array-builder"
116
- require "arrow/sparse-union-data-type"
117
- require "arrow/string-dictionary-array-builder"
118
- require "arrow/string-array-builder"
119
- require "arrow/stream-decoder"
120
- require "arrow/stream-listener"
121
- require "arrow/struct-array"
122
- require "arrow/struct-array-builder"
123
- require "arrow/struct-data-type"
124
- require "arrow/table"
125
- require "arrow/table-concatenate-options"
126
- require "arrow/table-formatter"
127
- require "arrow/table-list-formatter"
128
- require "arrow/table-table-formatter"
129
- require "arrow/table-loader"
130
- require "arrow/table-saver"
131
- require "arrow/tensor"
132
- require "arrow/time"
133
- require "arrow/time-unit"
134
- require "arrow/time32-array"
135
- require "arrow/time32-array-builder"
136
- require "arrow/time32-data-type"
137
- require "arrow/time64-array"
138
- require "arrow/time64-array-builder"
139
- require "arrow/time64-data-type"
140
- require "arrow/timestamp-array"
141
- require "arrow/timestamp-array-builder"
142
- require "arrow/timestamp-data-type"
143
- require "arrow/timestamp-parser"
144
- require "arrow/union-array-builder"
145
- require "arrow/writable"
37
+ require_relative "libraries"
146
38
  end
147
39
 
148
40
  def require_extension_library
@@ -150,7 +42,7 @@ module Arrow
150
42
  end
151
43
 
152
44
  def gc_guard
153
- require "arrow/constructor-arguments-gc-guardable"
45
+ require_relative "constructor-arguments-gc-guardable"
154
46
 
155
47
  [
156
48
  @base_module::BinaryScalar,
@@ -14,7 +14,9 @@
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
- name,score
18
- alice,10
19
- bob,
20
- chris,-1
17
+
18
+ require "extpp/setup"
19
+ require "gio2"
20
+
21
+ require_relative "loader"
22
+ Arrow::Loader.load
data/lib/arrow/version.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
 
18
18
  module Arrow
19
- VERSION = "18.1.0"
19
+ VERSION = "19.0.0"
20
20
 
21
21
  module Version
22
22
  numbers, TAG = VERSION.split("-")
data/lib/arrow.rb CHANGED
@@ -15,16 +15,11 @@
15
15
  # specific language governing permissions and limitations
16
16
  # under the License.
17
17
 
18
- require "extpp/setup"
19
- require "gio2"
20
-
21
18
  require "arrow/version"
22
19
 
23
- require "arrow/loader"
24
-
25
20
  module Arrow
26
21
  class Error < StandardError
27
22
  end
28
-
29
- Loader.load
30
23
  end
24
+
25
+ require_relative "arrow/#{RUBY_ENGINE}"
data/red-arrow.gemspec CHANGED
@@ -20,7 +20,11 @@
20
20
  require_relative "lib/arrow/version"
21
21
 
22
22
  Gem::Specification.new do |spec|
23
+ is_jruby = RUBY_ENGINE == "jruby"
24
+
23
25
  spec.name = "red-arrow"
26
+ spec.platform = "java" if is_jruby
27
+
24
28
  version_components = [
25
29
  Arrow::Version::MAJOR.to_s,
26
30
  Arrow::Version::MINOR.to_s,
@@ -43,15 +47,20 @@ Gem::Specification.new do |spec|
43
47
  spec.files += Dir.glob("lib/**/*.rb")
44
48
  spec.files += Dir.glob("image/*.*")
45
49
  spec.files += Dir.glob("doc/text/*")
46
- spec.test_files += Dir.glob("test/**/*")
47
- spec.extensions = ["ext/arrow/extconf.rb"]
50
+ spec.extensions = ["ext/arrow/extconf.rb"] unless is_jruby
48
51
 
49
52
  spec.add_runtime_dependency("bigdecimal", ">= 3.1.0")
50
53
  spec.add_runtime_dependency("csv")
51
- spec.add_runtime_dependency("extpp", ">= 0.1.1")
52
- spec.add_runtime_dependency("gio2", ">= 4.2.3")
53
- spec.add_runtime_dependency("native-package-installer")
54
- spec.add_runtime_dependency("pkg-config")
54
+ if is_jruby
55
+ spec.add_runtime_dependency("jar-dependencies")
56
+ spec.requirements << "jar org.apache.arrow, arrow-vector, #{spec.version}"
57
+ spec.requirements << "jar org.apache.arrow, arrow-memory-netty, #{spec.version}"
58
+ else
59
+ spec.add_runtime_dependency("extpp", ">= 0.1.1")
60
+ spec.add_runtime_dependency("gio2", ">= 4.2.3")
61
+ spec.add_runtime_dependency("native-package-installer")
62
+ spec.add_runtime_dependency("pkg-config")
63
+ end
55
64
 
56
65
  required_msys2_package_version = version_components[0, 3].join(".")
57
66
  spec.metadata["msys2_mingw_dependencies"] =