| 535 | } |
| 536 | |
| 537 | Result<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 |
nothing calls this directly
no test coverage detected