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

Function ParseOne

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

Source from the content-addressed store, hash-verified

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