MCPcopy Create free account
hub / github.com/apache/arrow / Table__from_RecordBatchFileReader

Function Table__from_RecordBatchFileReader

r/src/recordbatchreader.cpp:270–281  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

268
269// [[arrow::export]]
270std::shared_ptr<arrow::Table> Table__from_RecordBatchFileReader(
271 const std::shared_ptr<arrow::ipc::RecordBatchFileReader>& reader) {
272 // RecordBatchStreamReader inherits from RecordBatchReader
273 // but RecordBatchFileReader apparently does not
274 int num_batches = reader->num_record_batches();
275 std::vector<std::shared_ptr<arrow::RecordBatch>> batches(num_batches);
276 for (int i = 0; i < num_batches; i++) {
277 batches[i] = ValueOrStop(reader->ReadRecordBatch(i));
278 }
279
280 return ValueOrStop(arrow::Table::FromRecordBatches(std::move(batches)));
281}
282
283// [[arrow::export]]
284cpp11::list ipc___RecordBatchFileReader__batches(

Calls 3

ValueOrStopFunction · 0.85
num_record_batchesMethod · 0.45
ReadRecordBatchMethod · 0.45

Tested by

no test coverage detected