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

Method ReadBatches

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

Source from the content-addressed store, hash-verified

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