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

Method ReadCachedRecordBatch

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

Source from the content-addressed store, hash-verified

1870 };
1871
1872 Future<std::shared_ptr<RecordBatch>> ReadCachedRecordBatch(
1873 int index, Future<std::shared_ptr<Message>> message_fut) {
1874 stats_.num_record_batches.fetch_add(1, std::memory_order_relaxed);
1875 return dictionary_load_finished_.Then([message_fut] { return message_fut; })
1876 .Then([this, index](const std::shared_ptr<Message>& message_obj)
1877 -> Future<std::shared_ptr<RecordBatch>> {
1878 ARROW_ASSIGN_OR_RAISE(auto block, GetRecordBatchBlock(index));
1879 ARROW_ASSIGN_OR_RAISE(auto message, GetFlatbufMessage(message_obj));
1880 ARROW_ASSIGN_OR_RAISE(auto batch, GetBatchFromMessage(message));
1881 ARROW_ASSIGN_OR_RAISE(auto context, GetIpcReadContext(message, batch));
1882
1883 auto read_context = std::make_shared<CachedRecordBatchReadContext>(
1884 schema_, batch, std::move(context), file_, owned_file_,
1885 block.offset + static_cast<int64_t>(block.metadata_length),
1886 block.body_length);
1887 RETURN_NOT_OK(read_context->CalculateLoadRequest());
1888 return read_context->ReadAsync().Then(
1889 [read_context] { return read_context->CreateRecordBatch(); });
1890 });
1891 }
1892
1893 Status ReadFooter() {
1894 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