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

Function MakeBatchGenerator

cpp/src/arrow/dataset/file_json.cc:322–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320}
321
322Result<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
335Result<std::shared_ptr<InspectedFragment>> DoInspectFragment(
336 const FileSource& source, const JsonFragmentScanOptions& format_options,

Callers

nothing calls this directly

Calls 4

resultMethod · 0.45
okMethod · 0.45
statusMethod · 0.45
ReadNextAsyncMethod · 0.45

Tested by

no test coverage detected