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

Class WholeIpcFileRecordBatchGenerator

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

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

Source from the content-addressed store, hash-verified

1303///
1304/// All batches are yielded in order.
1305class WholeIpcFileRecordBatchGenerator {
1306 public:
1307 using Item = std::shared_ptr<RecordBatch>;
1308
1309 explicit WholeIpcFileRecordBatchGenerator(
1310 std::shared_ptr<RecordBatchFileReaderImpl> state,
1311 std::shared_ptr<io::internal::ReadRangeCache> cached_source,
1312 const io::IOContext& io_context, arrow::internal::Executor* executor)
1313 : state_(std::move(state)),
1314 cached_source_(std::move(cached_source)),
1315 io_context_(io_context),
1316 executor_(executor),
1317 index_(0) {}
1318
1319 Future<Item> operator()();
1320 Future<std::shared_ptr<Message>> ReadBlock(const FileBlock& block);
1321
1322 static Status ReadDictionaries(
1323 RecordBatchFileReaderImpl* state,
1324 std::vector<std::shared_ptr<Message>> dictionary_messages);
1325 static Result<std::shared_ptr<RecordBatch>> ReadRecordBatch(
1326 RecordBatchFileReaderImpl* state, Message* message);
1327
1328 private:
1329 std::shared_ptr<RecordBatchFileReaderImpl> state_;
1330 std::shared_ptr<io::internal::ReadRangeCache> cached_source_;
1331 io::IOContext io_context_;
1332 arrow::internal::Executor* executor_;
1333 int index_;
1334 // Odd Future type, but this lets us use All() easily
1335 Future<> read_dictionaries_;
1336};
1337
1338/// A generator of record batches for use when reading
1339/// a subset of columns from the file.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected