| 61 | } |
| 62 | |
| 63 | static 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 | |
| 93 | static inline Result<std::vector<int>> GetIncludedFields( |
| 94 | const Schema& schema, const std::vector<FieldRef>& materialized_fields) { |
no test coverage detected