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

Method WithNames

cpp/src/arrow/type.cc:2454–2467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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