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

Function AppendMetadataFingerprint

cpp/src/arrow/type.cc:2791–2808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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