Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c_glib/arrow-glib/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ GArrowTableBatchReader *
garrow_table_batch_reader_new(GArrowTable *table)
{
auto arrow_table = garrow_table_get_raw(table);
auto arrow_table_batch_reader = std::make_shared<arrow::TableBatchReader>(*arrow_table);
auto arrow_table_batch_reader = std::make_shared<arrow::TableBatchReader>(arrow_table);
return garrow_table_batch_reader_new_raw(&arrow_table_batch_reader, table);
}

Expand Down
12 changes: 12 additions & 0 deletions c_glib/test/test-table-batch-reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

class TestTableBatchReader < Test::Unit::TestCase
include Helper::Buildable
include Helper::Omittable

def test_empty
table = build_table("visible" => build_boolean_array([]))
Expand Down Expand Up @@ -51,4 +52,15 @@ def test_max_chunk_size
reader.read_next)
assert_nil(reader.read_next)
end

def test_export_gc
require_gi_bindings(3, 4, 8)
array = build_int32_array([1, 2, 3])
table = build_table("number" => array)
c_abi_array_stream = Arrow::TableBatchReader.new(table).export
table = nil
GC.start
assert_equal(build_table("number" => array),
Arrow::RecordBatchReader.import(c_abi_array_stream).read_all)
end
end
Loading