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

Function OpenReaderAsync

cpp/src/arrow/dataset/file_ipc.cc:63–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63static inline Future<std::shared_ptr<ipc::RecordBatchFileReader>> OpenReaderAsync(
64 const FileSource& source,
65 const ipc::IpcReadOptions& options = default_read_options()) {
66#ifdef ARROW_WITH_OPENTELEMETRY
67 auto tracer = arrow::internal::tracing::GetTracer();
68 auto span = tracer->StartSpan("arrow::dataset::IpcFileFormat::OpenReaderAsync");
69#endif
70 ARROW_ASSIGN_OR_RAISE(auto input, source.Open());
71 auto path = source.path();
72 return ipc::RecordBatchFileReader::OpenAsync(std::move(input), options)
73 .Then(
74 [=](const std::shared_ptr<ipc::RecordBatchFileReader>& reader)
75 -> Result<std::shared_ptr<ipc::RecordBatchFileReader>> {
76#ifdef ARROW_WITH_OPENTELEMETRY
77 span->SetStatus(opentelemetry::trace::StatusCode::kOk);
78 span->End();
79#endif
80 return reader;
81 },
82 [=](const Status& status)
83 -> Result<std::shared_ptr<ipc::RecordBatchFileReader>> {
84#ifdef ARROW_WITH_OPENTELEMETRY
85 arrow::internal::tracing::MarkSpan(status, span.get());
86 span->End();
87#endif
88 return status.WithMessage("Could not open IPC input source '", path,
89 "': ", status.message());
90 });
91}
92
93static inline Result<std::vector<int>> GetIncludedFields(
94 const Schema& schema, const std::vector<FieldRef>& materialized_fields) {

Callers 1

ScanBatchesAsyncMethod · 0.70

Calls 7

default_read_optionsFunction · 0.85
GetTracerFunction · 0.85
MarkSpanFunction · 0.85
ThenMethod · 0.80
pathMethod · 0.45
EndMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected