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

Method ReadBatches

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

Source from the content-addressed store, hash-verified

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