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

Function AppendMetadataFingerprint

cpp/src/arrow/type.cc:2796–2813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2794}
2795
2796static void AppendMetadataFingerprint(const KeyValueMetadata& metadata,
2797 std::stringstream* ss) {
2798 // Compute metadata fingerprint. KeyValueMetadata is not immutable,
2799 // so we don't cache the result on the metadata instance.
2800 const auto pairs = metadata.sorted_pairs();
2801 if (!pairs.empty()) {
2802 *ss << "!{";
2803 for (const auto& p : pairs) {
2804 const auto& k = p.first;
2805 const auto& v = p.second;
2806 // Since metadata strings can contain arbitrary characters, prefix with
2807 // string length to disambiguate.
2808 *ss << k.length() << ':' << k << ':';
2809 *ss << v.length() << ':' << v << ';';
2810 }
2811 *ss << '}';
2812 }
2813}
2814
2815std::string Field::ComputeFingerprint() const {
2816 const auto& type_fingerprint = type_->fingerprint();

Callers 1

Calls 3

sorted_pairsMethod · 0.80
emptyMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected