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

Method ReadBatches

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

Source from the content-addressed store, hash-verified

1209 }
1210
1211 virtual Status ReadBatches(const IpcReadOptions& options,
1212 RecordBatchVector* out_batches,
1213 ReadStats* out_stats = nullptr,
1214 MetadataVector* out_metadata_list = nullptr) {
1215 auto buf_reader = std::make_shared<io::BufferReader>(buffer_);
1216 ARROW_ASSIGN_OR_RAISE(auto reader, RecordBatchFileReader::Open(
1217 buf_reader.get(), footer_offset_, options));
1218
1219 EXPECT_EQ(num_batches_written_, reader->num_record_batches());
1220 for (int i = 0; i < num_batches_written_; ++i) {
1221 ARROW_ASSIGN_OR_RAISE(auto chunk_with_metadata,
1222 reader->ReadRecordBatchWithCustomMetadata(i));
1223 auto chunk = chunk_with_metadata.batch;
1224 out_batches->push_back(chunk);
1225 if (out_metadata_list) {
1226 auto metadata = chunk_with_metadata.custom_metadata;
1227 out_metadata_list->push_back(metadata);
1228 }
1229 }
1230 if (out_stats) {
1231 *out_stats = reader->stats();
1232 }
1233 return Status::OK();
1234 }
1235
1236 Status ReadSchema(std::shared_ptr<Schema>* out) {
1237 return ReadSchema(ipc::IpcReadOptions::Defaults(), out);

Callers 7

RoundTripHelperMethod · 0.45
RoundTripMethod · 0.45
RoundTripTableMethod · 0.45

Calls 4

push_backMethod · 0.80
OKFunction · 0.50
num_record_batchesMethod · 0.45
statsMethod · 0.45

Tested by

no test coverage detected