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

Method WithNames

cpp/src/arrow/type.cc:2451–2464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2449}
2450
2451Result<std::shared_ptr<Schema>> Schema::WithNames(
2452 const std::vector<std::string>& names) const {
2453 if (names.size() != impl_->fields_.size()) {
2454 return Status::Invalid("attempted to rename schema with ", impl_->fields_.size(),
2455 " fields but only ", names.size(), " new names were given");
2456 }
2457 FieldVector new_fields;
2458 new_fields.reserve(names.size());
2459 auto names_itr = names.begin();
2460 for (const auto& field : impl_->fields_) {
2461 new_fields.push_back(field->WithName(*names_itr++));
2462 }
2463 return schema(std::move(new_fields));
2464}
2465
2466std::shared_ptr<Schema> Schema::WithMetadata(
2467 const std::shared_ptr<const KeyValueMetadata>& metadata) const {

Callers 5

InitializeSchemaMethod · 0.80
StartProducingMethod · 0.80
Schema__WithNamesFunction · 0.80

Calls 7

push_backMethod · 0.80
WithNameMethod · 0.80
InvalidFunction · 0.70
schemaFunction · 0.70
sizeMethod · 0.45
reserveMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected