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

Method Init

cpp/src/arrow/json/from_string.cc:728–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726 explicit StructConverter(const std::shared_ptr<DataType>& type) { type_ = type; }
727
728 Status Init() override {
729 std::vector<std::shared_ptr<ArrayBuilder>> child_builders;
730 for (const auto& field : type_->fields()) {
731 std::shared_ptr<JSONConverter> child_converter;
732 RETURN_NOT_OK(GetConverter(field->type(), &child_converter));
733 child_converters_.push_back(child_converter);
734 child_builders.push_back(child_converter->builder());
735 }
736 for (int32_t i = 0; i < type_->num_fields(); ++i) {
737 field_index_.emplace(type_->field(i)->name(), i);
738 }
739 builder_ = std::make_shared<StructBuilder>(type_, default_memory_pool(),
740 std::move(child_builders));
741 return Status::OK();
742 }
743
744 // Append a JSON value that is either an array of N elements in order
745 // or an object mapping struct names to values (omitted struct members

Callers

nothing calls this directly

Calls 10

default_memory_poolFunction · 0.85
push_backMethod · 0.80
GetConverterFunction · 0.70
OKFunction · 0.70
fieldsMethod · 0.45
typeMethod · 0.45
builderMethod · 0.45
num_fieldsMethod · 0.45
nameMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected