| 38 | namespace { |
| 39 | |
| 40 | Result<std::unique_ptr<arrow::adapters::orc::ORCFileReader>> OpenORCReader( |
| 41 | const FileSource& source, |
| 42 | const std::shared_ptr<ScanOptions>& scan_options = nullptr) { |
| 43 | ARROW_ASSIGN_OR_RAISE(auto input, source.Open()); |
| 44 | |
| 45 | arrow::MemoryPool* pool; |
| 46 | if (scan_options) { |
| 47 | pool = scan_options->pool; |
| 48 | } else { |
| 49 | pool = default_memory_pool(); |
| 50 | } |
| 51 | |
| 52 | auto reader = arrow::adapters::orc::ORCFileReader::Open(std::move(input), pool); |
| 53 | auto status = reader.status(); |
| 54 | if (!status.ok()) { |
| 55 | return status.WithMessage("Could not open ORC input source '", source.path(), |
| 56 | "': ", status.message()); |
| 57 | } |
| 58 | return reader; |
| 59 | } |
| 60 | |
| 61 | /// \brief A ScanTask backed by an ORC file. |
| 62 | class OrcScanTask { |
no test coverage detected