| 320 | } |
| 321 | |
| 322 | Result<RecordBatchGenerator> MakeBatchGenerator( |
| 323 | const JsonFileFormat& format, const std::shared_ptr<ScanOptions>& scan_options, |
| 324 | const std::shared_ptr<FileFragment>& file) { |
| 325 | ARROW_ASSIGN_OR_RAISE(auto future, DoOpenReader(file->source(), format, scan_options)); |
| 326 | auto maybe_reader = future.result(); |
| 327 | // Defer errors that occurred during reader instantiation since they're likely related |
| 328 | // to batch-processing. |
| 329 | if (!maybe_reader.ok()) { |
| 330 | return MakeFailingGenerator<std::shared_ptr<RecordBatch>>(maybe_reader.status()); |
| 331 | } |
| 332 | return [reader = *std::move(maybe_reader)] { return reader->ReadNextAsync(); }; |
| 333 | } |
| 334 | |
| 335 | Result<std::shared_ptr<InspectedFragment>> DoInspectFragment( |
| 336 | const FileSource& source, const JsonFragmentScanOptions& format_options, |
nothing calls this directly
no test coverage detected