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

Method ReadCachedRecordBatch

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

Source from the content-addressed store, hash-verified

1842 };
1843
1844 Future<std::shared_ptr<RecordBatch>> ReadCachedRecordBatch(
1845 int index, Future<std::shared_ptr<Message>> message_fut) {
1846 stats_.num_record_batches.fetch_add(1, std::memory_order_relaxed);
1847 return dictionary_load_finished_.Then([message_fut] { return message_fut; })
1848 .Then([this, index](const std::shared_ptr<Message>& message_obj)
1849 -> Future<std::shared_ptr<RecordBatch>> {
1850 ARROW_ASSIGN_OR_RAISE(auto block, GetRecordBatchBlock(index));
1851 ARROW_ASSIGN_OR_RAISE(auto message, GetFlatbufMessage(message_obj));
1852 ARROW_ASSIGN_OR_RAISE(auto batch, GetBatchFromMessage(message));
1853 ARROW_ASSIGN_OR_RAISE(auto context, GetIpcReadContext(message, batch));
1854
1855 auto read_context = std::make_shared<CachedRecordBatchReadContext>(
1856 schema_, batch, std::move(context), file_, owned_file_,
1857 block.offset + static_cast<int64_t>(block.metadata_length),
1858 block.body_length);
1859 RETURN_NOT_OK(read_context->CalculateLoadRequest());
1860 return read_context->ReadAsync().Then(
1861 [read_context] { return read_context->CreateRecordBatch(); });
1862 });
1863 }
1864
1865 Status ReadFooter() {
1866 auto fut = ReadFooterAsync(/*executor=*/nullptr);

Callers

nothing calls this directly

Calls 4

ThenMethod · 0.80
CalculateLoadRequestMethod · 0.80
ReadAsyncMethod · 0.45
CreateRecordBatchMethod · 0.45

Tested by

no test coverage detected