red-arrow 12.0.0 → 13.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: 583b384182a9906a4fcd723cb67b0600b07dd962a1d45e114619014a396800c6
4
- data.tar.gz: 97b7a63c52c678b7255a520d768f59fde993ffd2fd9014f24b0b946940f656b8
3
+ metadata.gz: dcbc004b8b61405c6e1143428ca37aac1be3de4d31d73f0a235f9c2e8d7bf5bb
4
+ data.tar.gz: 508ba001225d07eae018b7552987c6102a8b59c98f4d717b4e88ad1a188d84b3
5
5
  SHA512:
6
- metadata.gz: ab37d28349e4a3b23b629c4a2431a48e6b0a0b4884fb0274a484965e5c2ed551cc5b7b998433940c8e992135803f65a4c3b0555abebd6478fdaeb665f70e3f25
7
- data.tar.gz: cfb8de7ce8d9b9cabb76f016e51bde489f9c58fc42253612395082a9ccab79001f56978d102ef18ac93f31e696406980304f2d4e40af46e8b2ba041363308920
6
+ metadata.gz: 5cbeae509369615824b6c5d41d8f97d4b166ca99d9b1dc3fba4207e726ac22a0147027cb531761ba91245df7d71bb02ab370221ec72359470149ace65b2a01f7
7
+ data.tar.gz: 2043d58148d1370789ad6b75ed605b7d3a78c1094f2250a09b0857a43d24f37a83a5706b3b96b41dfa7f0dafa22179dde63a4e991e58e85f19002759cfed52b8
data/ext/arrow/arrow.cpp CHANGED
@@ -43,6 +43,26 @@ namespace red_arrow {
43
43
  VALUE month;
44
44
  VALUE nanosecond;
45
45
  }
46
+
47
+ void
48
+ record_batch_reader_mark(gpointer object)
49
+ {
50
+ auto reader = GARROW_RECORD_BATCH_READER(object);
51
+ auto sources = garrow_record_batch_reader_get_sources(reader);
52
+ for (auto source = sources; sources; sources = g_list_next(sources)) {
53
+ rbgobj_gc_mark_instance(source->data);
54
+ }
55
+ }
56
+
57
+ void
58
+ execute_plan_mark(gpointer object)
59
+ {
60
+ auto plan = GARROW_EXECUTE_PLAN(object);
61
+ auto nodes = garrow_execute_plan_get_nodes(plan);
62
+ for (auto node = nodes; nodes; nodes = g_list_next(nodes)) {
63
+ rbgobj_gc_mark_instance(node->data);
64
+ }
65
+ }
46
66
  }
47
67
 
48
68
  extern "C" void Init_arrow() {
@@ -93,4 +113,9 @@ extern "C" void Init_arrow() {
93
113
  red_arrow::symbols::millisecond = ID2SYM(rb_intern("millisecond"));
94
114
  red_arrow::symbols::month = ID2SYM(rb_intern("month"));
95
115
  red_arrow::symbols::nanosecond = ID2SYM(rb_intern("nanosecond"));
116
+
117
+ rbgobj_register_mark_func(GARROW_TYPE_RECORD_BATCH_READER,
118
+ red_arrow::record_batch_reader_mark);
119
+ rbgobj_register_mark_func(GARROW_TYPE_EXECUTE_PLAN,
120
+ red_arrow::execute_plan_mark);
96
121
  }
data/ext/arrow/extconf.rb CHANGED
@@ -41,9 +41,8 @@ end
41
41
  unless required_pkg_config_package([
42
42
  "arrow",
43
43
  Arrow::Version::MAJOR,
44
- Arrow::Version::MINOR,
45
- Arrow::Version::MICRO,
46
44
  ],
45
+ conda: "libarrow",
47
46
  debian: "libarrow-dev",
48
47
  fedora: "libarrow-devel",
49
48
  homebrew: "apache-arrow",
@@ -58,6 +57,7 @@ unless required_pkg_config_package([
58
57
  Arrow::Version::MINOR,
59
58
  Arrow::Version::MICRO,
60
59
  ],
60
+ conda: "arrow-c-glib",
61
61
  debian: "libarrow-glib-dev",
62
62
  fedora: "libarrow-glib-devel",
63
63
  homebrew: "apache-arrow-glib",
@@ -29,7 +29,11 @@ module Arrow
29
29
  end
30
30
 
31
31
  def to_arrow_array
32
- combine
32
+ if n_chunks.zero?
33
+ value_data_type.build_array([])
34
+ else
35
+ combine
36
+ end
33
37
  end
34
38
 
35
39
  def to_arrow_chunked_array
@@ -31,10 +31,14 @@ module Arrow
31
31
  else
32
32
  return nil
33
33
  end
34
+ options = nil
34
35
  if arguments.last.is_a?(FunctionOptions)
35
36
  options = arguments.pop
36
- else
37
- options = nil
37
+ elsif arguments.last.is_a?(Hash)
38
+ function = Function.find(function_name)
39
+ if function
40
+ options = function.resolve_options(arguments.pop)
41
+ end
38
42
  end
39
43
  CallExpression.new(function_name, arguments, options)
40
44
  else
@@ -24,7 +24,6 @@ module Arrow
24
24
  end
25
25
  alias_method :call, :execute
26
26
 
27
- private
28
27
  def resolve_options(options)
29
28
  return nil if options.nil?
30
29
  return options if options.is_a?(FunctionOptions)
data/lib/arrow/slicer.rb CHANGED
@@ -189,7 +189,7 @@ module Arrow
189
189
  message =
190
190
  "pattern must be either String or Regexp: #{pattern.inspect}"
191
191
  raise ArgumentError, message
192
- end
192
+ end
193
193
  end
194
194
 
195
195
  def start_with?(substring, ignore_case: false)
data/lib/arrow/version.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  # under the License.
17
17
 
18
18
  module Arrow
19
- VERSION = "12.0.0"
19
+ VERSION = "13.0.0"
20
20
 
21
21
  module Version
22
22
  numbers, TAG = VERSION.split("-")
@@ -36,5 +36,16 @@ class TestExpression < Test::Unit::TestCase
36
36
  assert_equal(Arrow::CallExpression.new("func", ["argument1"]),
37
37
  Arrow::Expression.try_convert(["func", "argument1"]))
38
38
  end
39
+
40
+ test("[Symbol, String, Hash]") do
41
+ options = Arrow::MatchSubstringOptions.new
42
+ options.pattern = "hello"
43
+ assert_equal(Arrow::CallExpression.new("match_substring",
44
+ ["content"],
45
+ options),
46
+ Arrow::Expression.try_convert([:match_substring,
47
+ "content",
48
+ {pattern: "hello"}]))
49
+ end
39
50
  end
40
51
  end
data/test/test-table.rb CHANGED
@@ -589,6 +589,13 @@ class TableTest < Test::Unit::TestCase
589
589
  0 1
590
590
  TABLE
591
591
  end
592
+
593
+ test("empty result") do
594
+ selected_table = @table.filter([false] * @table.size).select_columns(:a)
595
+ assert_equal(<<-TABLE, selected_table.to_s)
596
+ a
597
+ TABLE
598
+ end
592
599
  end
593
600
 
594
601
  sub_test_case("#column_names") 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: 12.0.0
4
+ version: 13.0.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: 2023-05-08 00:00:00.000000000 Z
11
+ date: 2023-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -323,7 +323,7 @@ homepage: https://arrow.apache.org/
323
323
  licenses:
324
324
  - Apache-2.0
325
325
  metadata:
326
- msys2_mingw_dependencies: arrow>=12.0.0
326
+ msys2_mingw_dependencies: arrow>=13.0.0
327
327
  post_install_message:
328
328
  rdoc_options: []
329
329
  require_paths: