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

Method ReadBatches

cpp/src/arrow/ipc/read_write_test.cc:1360–1377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1358 }
1359
1360 virtual Status ReadBatches(const IpcReadOptions& options,
1361 RecordBatchVector* out_batches,
1362 ReadStats* out_stats = nullptr,
1363 MetadataVector* out_metadata_list = nullptr) {
1364 auto buf_reader = std::make_shared<io::BufferReader>(buffer_);
1365 ARROW_ASSIGN_OR_RAISE(auto reader, RecordBatchStreamReader::Open(buf_reader, options))
1366 if (out_metadata_list) {
1367 while (true) {
1368 ARROW_ASSIGN_OR_RAISE(auto chunk_with_metadata, reader->ReadNext());
1369 if (chunk_with_metadata.batch == nullptr) {
1370 break;
1371 }
1372 out_batches->push_back(chunk_with_metadata.batch);
1373 out_metadata_list->push_back(chunk_with_metadata.custom_metadata);
1374 }
1375 } else {
1376 ARROW_ASSIGN_OR_RAISE(*out_batches, reader->ToRecordBatches());
1377 }
1378
1379 if (out_stats) {
1380 *out_stats = reader->stats();

Callers

nothing calls this directly

Calls 2

ARROW_ASSIGN_OR_RAISEFunction · 0.70
ToRecordBatchesMethod · 0.45

Tested by

no test coverage detected