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

Method Init

cpp/src/arrow/util/converter.h:165–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164 protected:
165 Status Init(MemoryPool* pool) override {
166 std::unique_ptr<BaseConverter> child_converter;
167 std::vector<std::shared_ptr<ArrayBuilder>> child_builders;
168
169 struct_type_ = checked_cast<const StructType*>(this->type_.get());
170 for (const auto& field : struct_type_->fields()) {
171 ARROW_ASSIGN_OR_RAISE(child_converter,
172 (MakeConverter<BaseConverter, ConverterTrait>(
173 field->type(), this->options_, pool)));
174 this->may_overflow_ |= child_converter->may_overflow();
175 this->rewind_on_overflow_ = this->may_overflow_;
176 child_builders.push_back(child_converter->builder());
177 children_.push_back(std::move(child_converter));
178 }
179
180 this->builder_ =
181 std::make_shared<StructBuilder>(this->type_, pool, std::move(child_builders));
182 struct_builder_ = checked_cast<StructBuilder*>(this->builder_.get());
183
184 return Status::OK();
185 }
186
187 const StructType* struct_type_;
188 StructBuilder* struct_builder_;

Callers

nothing calls this directly

Calls 8

may_overflowMethod · 0.80
push_backMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
getMethod · 0.45
fieldsMethod · 0.45
typeMethod · 0.45
builderMethod · 0.45

Tested by

no test coverage detected