Skip to content
Closed
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
10 changes: 10 additions & 0 deletions ruby/red-arrow/test/test-record-batch-reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,14 @@ class TestRecordBatchReader < Test::Unit::TestCase
reader.read_all)
end
end

test("exported TableBatchReader keeps its table alive") do
expected = Arrow::Table.new("count" => [1, 2, 3])
stream =
Arrow::TableBatchReader.new(Arrow::Table.new("count" => [1, 2, 3])).export
GC.start

reader = Arrow::RecordBatchReader.import(stream)
assert_equal(expected, reader.read_all)
end
end
Loading