| 88 | |
| 89 | template <typename T> |
| 90 | static 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 | |
| 100 | TEST(HashingQuality, Int64) { |
| 101 | #ifdef ARROW_VALGRIND |