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

Function ParseOne

cpp/src/arrow/json/reader.cc:537–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535}
536
537Result<std::shared_ptr<RecordBatch>> ParseOne(ParseOptions options,
538 std::shared_ptr<Buffer> json) {
539 DecodeContext context(std::move(options));
540
541 std::unique_ptr<BlockParser> parser;
542 RETURN_NOT_OK(BlockParser::Make(context.parse_options(), &parser));
543 RETURN_NOT_OK(parser->Parse(json));
544 std::shared_ptr<Array> parsed;
545 RETURN_NOT_OK(parser->Finish(&parsed));
546
547 std::shared_ptr<ChunkedArrayBuilder> builder;
548 RETURN_NOT_OK(MakeChunkedArrayBuilder(TaskGroup::MakeSerial(), context.pool(),
549 context.promotion_graph(),
550 context.conversion_type(), &builder));
551
552 builder->Insert(0, field("", context.conversion_type()), parsed);
553 std::shared_ptr<ChunkedArray> converted_chunked;
554 RETURN_NOT_OK(builder->Finish(&converted_chunked));
555
556 return RecordBatch::FromStructArray(converted_chunked->chunk(0), context.pool());
557}
558
559} // namespace json
560} // namespace arrow

Callers

nothing calls this directly

Calls 8

MakeChunkedArrayBuilderFunction · 0.85
promotion_graphMethod · 0.80
MakeFunction · 0.50
fieldFunction · 0.50
ParseMethod · 0.45
FinishMethod · 0.45
poolMethod · 0.45
InsertMethod · 0.45

Tested by

no test coverage detected