| 315 | // Group node |
| 316 | |
| 317 | GroupNode::GroupNode(const std::string& name, Repetition::type repetition, |
| 318 | const NodeVector& fields, ConvertedType::type converted_type, int id) |
| 319 | : Node(Node::GROUP, name, repetition, converted_type, id), fields_(fields) { |
| 320 | // For forward compatibility, create an equivalent logical type |
| 321 | logical_type_ = LogicalType::FromConvertedType(converted_type_); |
| 322 | if (!(logical_type_ && (logical_type_->is_nested() || logical_type_->is_none()) && |
| 323 | logical_type_->is_compatible(converted_type_))) { |
| 324 | ThrowInvalidLogicalType(*logical_type_); |
| 325 | } |
| 326 | |
| 327 | field_name_to_idx_.clear(); |
| 328 | auto field_idx = 0; |
| 329 | for (NodePtr& field : fields_) { |
| 330 | field->SetParent(this); |
| 331 | field_name_to_idx_.emplace(field->name(), field_idx++); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | GroupNode::GroupNode(const std::string& name, Repetition::type repetition, |
| 336 | const NodeVector& fields, |
nothing calls this directly
no test coverage detected