diff --git a/dbms/src/Columns/ColumnDecimal.cpp b/dbms/src/Columns/ColumnDecimal.cpp index 373255963d0..2a0e9c8291e 100644 --- a/dbms/src/Columns/ColumnDecimal.cpp +++ b/dbms/src/Columns/ColumnDecimal.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include diff --git a/dbms/src/Columns/ColumnVector.cpp b/dbms/src/Columns/ColumnVector.cpp index a96a4605cc6..fa60d562814 100644 --- a/dbms/src/Columns/ColumnVector.cpp +++ b/dbms/src/Columns/ColumnVector.cpp @@ -68,7 +68,20 @@ void ColumnVector::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(begin); + for (size_t i = 0; i < sizeof(T); i += sizeof(UInt64)) + { + *hash_data = intHashCRC32(*begin64, *hash_data); + ++begin64; + } + } + ++begin; ++hash_data; }