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

Method Make

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

Source from the content-addressed store, hash-verified

99 }
100
101 static Future<std::shared_ptr<FragmentScanner>> Make(
102 const FragmentScanRequest& scan_request,
103 const JsonFragmentScanOptions& format_options,
104 const JsonInspectedFragment& inspected, Executor* cpu_executor) {
105 auto parse_options = format_options.parse_options;
106 ARROW_ASSIGN_OR_RAISE(parse_options.explicit_schema,
107 GetSchema(scan_request, inspected));
108 parse_options.unexpected_field_behavior = json::UnexpectedFieldBehavior::Ignore;
109
110 int64_t block_size = format_options.read_options.block_size;
111 auto num_batches =
112 static_cast<int>(bit_util::CeilDiv(inspected.num_bytes, block_size));
113
114 auto future = json::StreamingReader::MakeAsync(
115 inspected.stream, format_options.read_options, parse_options,
116 io::default_io_context(), cpu_executor);
117 return future.Then([num_batches, block_size](const ReaderPtr& reader)
118 -> Result<std::shared_ptr<FragmentScanner>> {
119 return std::make_shared<JsonFragmentScanner>(reader, num_batches, block_size);
120 });
121 }
122
123 private:
124 ReaderPtr reader_;

Callers

nothing calls this directly

Calls 4

CeilDivFunction · 0.85
ThenMethod · 0.80
GetSchemaFunction · 0.70
ARROW_ASSIGN_OR_RAISEFunction · 0.50

Tested by

no test coverage detected