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

Method ExportMetadata

cpp/src/arrow/c/bridge.cc:289–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287 }
288
289 Status ExportMetadata(const KeyValueMetadata* orig_metadata) {
290 static const KeyValueMetadata empty_metadata;
291
292 if (orig_metadata == nullptr) {
293 orig_metadata = &empty_metadata;
294 }
295 if (additional_metadata_.empty()) {
296 if (orig_metadata->size() > 0) {
297 ARROW_ASSIGN_OR_RAISE(export_.metadata_, EncodeMetadata(*orig_metadata));
298 }
299 return Status::OK();
300 }
301 // Additional metadata needs to be appended to the existing
302 // (for extension types)
303 KeyValueMetadata metadata(orig_metadata->keys(), orig_metadata->values());
304 for (const auto& kv : additional_metadata_) {
305 // The metadata may already be there => ignore
306 if (metadata.Contains(kv.first)) {
307 continue;
308 }
309 metadata.Append(kv.first, kv.second);
310 }
311 ARROW_ASSIGN_OR_RAISE(export_.metadata_, EncodeMetadata(metadata));
312 return Status::OK();
313 }
314
315 Status SetFormat(std::string s) {
316 export_.format_ = std::move(s);

Callers

nothing calls this directly

Calls 9

EncodeMetadataFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
OKFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
keysMethod · 0.45
valuesMethod · 0.45
ContainsMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected