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

Method AppendChild

cpp/src/arrow/array/builder_union.cc:100–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100int8_t BasicUnionBuilder::AppendChild(const std::shared_ptr<ArrayBuilder>& new_child,
101 const std::string& field_name) {
102 children_.push_back(new_child);
103 auto new_type_id = NextTypeId();
104
105 type_id_to_child_id_[new_type_id] = static_cast<int>(children_.size() - 1);
106 type_id_to_children_[new_type_id] = new_child.get();
107 child_fields_.push_back(field(field_name, nullptr));
108 type_codes_.push_back(static_cast<int8_t>(new_type_id));
109
110 return new_type_id;
111}
112
113std::shared_ptr<DataType> BasicUnionBuilder::type() const {
114 std::vector<std::shared_ptr<Field>> child_fields(child_fields_.size());

Callers 4

AppendInferredMethod · 0.80
AppendListOfInferredMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.80

Calls 4

push_backMethod · 0.80
fieldFunction · 0.50
sizeMethod · 0.45
getMethod · 0.45

Tested by 3

AppendInferredMethod · 0.64
AppendListOfInferredMethod · 0.64
ASSERT_OK_AND_ASSIGNFunction · 0.64