| 703 | explicit StructConverter(const std::shared_ptr<DataType>& type) { type_ = type; } |
| 704 | |
| 705 | Status Init() override { |
| 706 | std::vector<std::shared_ptr<ArrayBuilder>> child_builders; |
| 707 | for (const auto& field : type_->fields()) { |
| 708 | std::shared_ptr<JSONConverter> child_converter; |
| 709 | RETURN_NOT_OK(GetConverter(field->type(), &child_converter)); |
| 710 | child_converters_.push_back(child_converter); |
| 711 | child_builders.push_back(child_converter->builder()); |
| 712 | } |
| 713 | builder_ = std::make_shared<StructBuilder>(type_, default_memory_pool(), |
| 714 | std::move(child_builders)); |
| 715 | return Status::OK(); |
| 716 | } |
| 717 | |
| 718 | // Append a JSON value that is either an array of N elements in order |
| 719 | // or an object mapping struct names to values (omitted struct members |
nothing calls this directly
no test coverage detected