diff --git a/src/AggregateFunctions/UniquesHashSet.h b/src/AggregateFunctions/UniquesHashSet.h index 075b0897c3a..2abf6ed00d6 100644 --- a/src/AggregateFunctions/UniquesHashSet.h +++ b/src/AggregateFunctions/UniquesHashSet.h @@ -331,7 +331,11 @@ public: void ALWAYS_INLINE insert(Value x) { - HashValue hash_value = hash(x); + HashValue hash_value; + if constexpr (std::endian::native == std::endian::little) + hash_value = hash(x); + else + hash_value = __builtin_bswap32(hash(x)); if (!good(hash_value)) return;