Fix build.

This commit is contained in:
Nikolai Kochetov 2020-03-18 19:40:23 +03:00
parent 9f82f43fdd
commit 6d1640643a
2 changed files with 15 additions and 1 deletions

View File

@ -3,6 +3,7 @@
#include <Common/SipHash.h>
#include <Common/assert_cast.h>
#include <Common/WeakHash.h>
#include <Common/HashTable/Hash.h>
#include <common/unaligned.h>

View File

@ -68,7 +68,20 @@ void ColumnVector<T>::updateWeakHash32(WeakHash32 & hash) const
while (begin < end)
{
*hash_data = intHashCRC32(*begin, *hash_data);
if constexpr (sizeof(T) <= sizeof(UInt64))
{
*hash_data = intHashCRC32(*begin, *hash_data);
}
else
{
auto * begin64 = reinterpret_cast<const UInt64 *>(begin);
for (size_t i = 0; i < sizeof(T); i += sizeof(UInt64))
{
*hash_data = intHashCRC32(*begin64, *hash_data);
++begin64;
}
}
++begin;
++hash_data;
}