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

Function CheckScalarHashQuality

cpp/src/arrow/util/hashing_test.cc:90–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89template <typename T>
90static void CheckScalarHashQuality(const std::unordered_set<T>& distinct_values) {
91 std::unordered_set<hash_t> hashes;
92 for (const auto v : distinct_values) {
93 hashes.insert(ScalarHelper<T, 0>::ComputeHash(v));
94 hashes.insert(ScalarHelper<T, 1>::ComputeHash(v));
95 }
96 ASSERT_GE(static_cast<double>(hashes.size()),
97 0.96 * static_cast<double>(2 * distinct_values.size()));
98}
99
100TEST(HashingQuality, Int64) {
101#ifdef ARROW_VALGRIND

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected