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

Class WholeIpcFileRecordBatchGenerator

cpp/src/arrow/ipc/reader.cc:1325–1356  ·  view source on GitHub ↗

A generator of record batches. All batches are yielded in order.

Source from the content-addressed store, hash-verified

1323///
1324/// All batches are yielded in order.
1325class WholeIpcFileRecordBatchGenerator {
1326 public:
1327 using Item = std::shared_ptr<RecordBatch>;
1328
1329 explicit WholeIpcFileRecordBatchGenerator(
1330 std::shared_ptr<RecordBatchFileReaderImpl> state,
1331 std::shared_ptr<io::internal::ReadRangeCache> cached_source,
1332 const io::IOContext& io_context, arrow::internal::Executor* executor)
1333 : state_(std::move(state)),
1334 cached_source_(std::move(cached_source)),
1335 io_context_(io_context),
1336 executor_(executor),
1337 index_(0) {}
1338
1339 Future<Item> operator()();
1340 Future<std::shared_ptr<Message>> ReadBlock(const FileBlock& block);
1341
1342 static Status ReadDictionaries(
1343 RecordBatchFileReaderImpl* state,
1344 std::vector<std::shared_ptr<Message>> dictionary_messages);
1345 static Result<std::shared_ptr<RecordBatch>> ReadRecordBatch(
1346 RecordBatchFileReaderImpl* state, Message* message);
1347
1348 private:
1349 std::shared_ptr<RecordBatchFileReaderImpl> state_;
1350 std::shared_ptr<io::internal::ReadRangeCache> cached_source_;
1351 io::IOContext io_context_;
1352 arrow::internal::Executor* executor_;
1353 int index_;
1354 // Odd Future type, but this lets us use All() easily
1355 Future<> read_dictionaries_;
1356};
1357
1358/// A generator of record batches for use when reading
1359/// a subset of columns from the file.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected