Coverage Report

Created: 2026-07-05 02:38

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/common/hash_table/hash.h
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
// This file is copied from
18
// https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/HashTable/Hash.h
19
// and modified by Doris
20
21
#pragma once
22
23
#include <type_traits>
24
25
#include "core/extended_types.h"
26
#include "core/string_ref.h"
27
#include "core/types.h"
28
#include "core/uint128.h"
29
#include "parallel_hashmap/phmap_utils.h"
30
31
// Here is an empirical value.
32
static constexpr size_t HASH_MAP_PREFETCH_DIST = 16;
33
34
/** Hash functions that are better than the trivial function std::hash.
35
  *
36
  * Example: when we do aggregation by the visitor ID, the performance increase is more than 5 times.
37
  * This is because of following reasons:
38
  * - in Yandex, visitor identifier is an integer that has timestamp with seconds resolution in lower bits;
39
  * - in typical implementation of standard library, hash function for integers is trivial and just use lower bits;
40
  * - traffic is non-uniformly distributed across a day;
41
  * - we are using open-addressing linear probing hash tables that are most critical to hash function quality,
42
  *   and trivial hash function gives disastrous results.
43
  */
44
45
/** Taken from MurmurHash. This is Murmur finalizer.
46
  * Faster than int_hash32 when inserting into the hash table UInt64 -> UInt64, where the key is the visitor ID.
47
  */
48
8.75k
inline doris::UInt64 int_hash64(doris::UInt64 x) {
49
8.75k
    x ^= x >> 33;
50
8.75k
    x *= 0xff51afd7ed558ccdULL;
51
8.75k
    x ^= x >> 33;
52
8.75k
    x *= 0xc4ceb9fe1a85ec53ULL;
53
8.75k
    x ^= x >> 33;
54
55
8.75k
    return x;
56
8.75k
}
57
58
/** CRC32C is not very high-quality as a hash function,
59
  *  according to avalanche and bit independence tests (see SMHasher software), as well as a small number of bits,
60
  *  but can behave well when used in hash tables,
61
  *  due to high speed (latency 3 + 1 clock cycle, throughput 1 clock cycle).
62
  * Works only with SSE 4.2 support.
63
  */
64
#include "util/sse_util.hpp"
65
66
13.7M
inline doris::UInt64 int_hash_crc32(doris::UInt64 x) {
67
13.7M
#if defined(__SSE4_2__) || (defined(__aarch64__) && defined(__ARM_FEATURE_CRC32))
68
13.7M
    return _mm_crc32_u64(-1ULL, x);
69
#else
70
    /// On other platforms we do not have CRC32. NOTE This can be confusing.
71
    return int_hash64(x);
72
#endif
73
13.7M
}
74
75
template <typename T>
76
7.41k
inline size_t default_hash64(T key) {
77
7.41k
    union {
78
7.41k
        T in;
79
7.41k
        doris::UInt64 out;
80
7.41k
    } u;
81
7.41k
    u.out = 0;
82
7.41k
    u.in = key;
83
7.41k
    return int_hash64(u.out);
84
7.41k
}
_Z14default_hash64IhEmT_
Line
Count
Source
76
40
inline size_t default_hash64(T key) {
77
40
    union {
78
40
        T in;
79
40
        doris::UInt64 out;
80
40
    } u;
81
40
    u.out = 0;
82
40
    u.in = key;
83
40
    return int_hash64(u.out);
84
40
}
_Z14default_hash64IaEmT_
Line
Count
Source
76
231
inline size_t default_hash64(T key) {
77
231
    union {
78
231
        T in;
79
231
        doris::UInt64 out;
80
231
    } u;
81
231
    u.out = 0;
82
231
    u.in = key;
83
231
    return int_hash64(u.out);
84
231
}
_Z14default_hash64IsEmT_
Line
Count
Source
76
904
inline size_t default_hash64(T key) {
77
904
    union {
78
904
        T in;
79
904
        doris::UInt64 out;
80
904
    } u;
81
904
    u.out = 0;
82
904
    u.in = key;
83
904
    return int_hash64(u.out);
84
904
}
_Z14default_hash64IiEmT_
Line
Count
Source
76
2.95k
inline size_t default_hash64(T key) {
77
2.95k
    union {
78
2.95k
        T in;
79
2.95k
        doris::UInt64 out;
80
2.95k
    } u;
81
2.95k
    u.out = 0;
82
2.95k
    u.in = key;
83
2.95k
    return int_hash64(u.out);
84
2.95k
}
_Z14default_hash64IlEmT_
Line
Count
Source
76
575
inline size_t default_hash64(T key) {
77
575
    union {
78
575
        T in;
79
575
        doris::UInt64 out;
80
575
    } u;
81
575
    u.out = 0;
82
575
    u.in = key;
83
575
    return int_hash64(u.out);
84
575
}
_Z14default_hash64InEmT_
Line
Count
Source
76
2.63k
inline size_t default_hash64(T key) {
77
2.63k
    union {
78
2.63k
        T in;
79
2.63k
        doris::UInt64 out;
80
2.63k
    } u;
81
2.63k
    u.out = 0;
82
2.63k
    u.in = key;
83
2.63k
    return int_hash64(u.out);
84
2.63k
}
_Z14default_hash64IfEmT_
Line
Count
Source
76
8
inline size_t default_hash64(T key) {
77
8
    union {
78
8
        T in;
79
8
        doris::UInt64 out;
80
8
    } u;
81
8
    u.out = 0;
82
8
    u.in = key;
83
8
    return int_hash64(u.out);
84
8
}
_Z14default_hash64IdEmT_
Line
Count
Source
76
11
inline size_t default_hash64(T key) {
77
11
    union {
78
11
        T in;
79
11
        doris::UInt64 out;
80
11
    } u;
81
11
    u.out = 0;
82
11
    u.in = key;
83
11
    return int_hash64(u.out);
84
11
}
_Z14default_hash64IjEmT_
Line
Count
Source
76
28
inline size_t default_hash64(T key) {
77
28
    union {
78
28
        T in;
79
28
        doris::UInt64 out;
80
28
    } u;
81
28
    u.out = 0;
82
28
    u.in = key;
83
28
    return int_hash64(u.out);
84
28
}
_Z14default_hash64IoEmT_
Line
Count
Source
76
28
inline size_t default_hash64(T key) {
77
28
    union {
78
28
        T in;
79
28
        doris::UInt64 out;
80
28
    } u;
81
28
    u.out = 0;
82
28
    u.in = key;
83
28
    return int_hash64(u.out);
84
28
}
85
86
template <typename T, typename Enable = void>
87
struct DefaultHash;
88
89
template <typename T>
90
    requires std::is_arithmetic_v<T>
91
struct DefaultHash<T> {
92
7.41k
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIhvEclEh
Line
Count
Source
92
40
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIavEclEa
Line
Count
Source
92
231
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIsvEclEs
Line
Count
Source
92
904
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIivEclEi
Line
Count
Source
92
2.95k
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIlvEclEl
Line
Count
Source
92
575
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashInvEclEn
Line
Count
Source
92
2.63k
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIfvEclEf
Line
Count
Source
92
8
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIdvEclEd
Line
Count
Source
92
11
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIjvEclEj
Line
Count
Source
92
28
    size_t operator()(T key) const { return default_hash64<T>(key); }
_ZNK11DefaultHashIovEclEo
Line
Count
Source
92
28
    size_t operator()(T key) const { return default_hash64<T>(key); }
93
};
94
95
template <>
96
struct DefaultHash<doris::VecDateTimeValue> {
97
0
    size_t operator()(doris::VecDateTimeValue key) const { return int_hash64(*(int64_t*)&key); }
98
};
99
100
template <>
101
struct DefaultHash<doris::DateV2Value<doris::DateTimeV2ValueType>> {
102
101
    size_t operator()(doris::DateV2Value<doris::DateTimeV2ValueType> key) const {
103
101
        return int_hash64(key.to_date_int_val());
104
101
    }
105
};
106
107
template <>
108
struct DefaultHash<doris::DateV2Value<doris::DateV2ValueType>> {
109
1.24k
    size_t operator()(doris::DateV2Value<doris::DateV2ValueType> key) const {
110
1.24k
        return int_hash64(key.to_date_int_val());
111
1.24k
    }
112
};
113
114
template <>
115
struct DefaultHash<doris::TimestampTzValue> {
116
0
    size_t operator()(doris::TimestampTzValue key) const {
117
0
        return int_hash64(key.to_date_int_val());
118
0
    }
119
};
120
121
template <>
122
struct DefaultHash<doris::StringRef> : public doris::StringRefHash {};
123
124
template <>
125
struct DefaultHash<wide::Int256> : public std::hash<wide::Int256> {};
126
127
template <typename T>
128
struct HashCRC32;
129
130
template <typename T>
131
13.8M
inline size_t hash_crc32(T key) {
132
13.8M
    union {
133
13.8M
        T in;
134
13.8M
        doris::UInt64 out;
135
13.8M
    } u;
136
13.8M
    u.out = 0;
137
13.8M
    u.in = key;
138
13.8M
    return int_hash_crc32(u.out);
139
13.8M
}
_Z10hash_crc32IhEmT_
Line
Count
Source
131
53.1k
inline size_t hash_crc32(T key) {
132
53.1k
    union {
133
53.1k
        T in;
134
53.1k
        doris::UInt64 out;
135
53.1k
    } u;
136
53.1k
    u.out = 0;
137
53.1k
    u.in = key;
138
53.1k
    return int_hash_crc32(u.out);
139
53.1k
}
_Z10hash_crc32IaEmT_
Line
Count
Source
131
8.90k
inline size_t hash_crc32(T key) {
132
8.90k
    union {
133
8.90k
        T in;
134
8.90k
        doris::UInt64 out;
135
8.90k
    } u;
136
8.90k
    u.out = 0;
137
8.90k
    u.in = key;
138
8.90k
    return int_hash_crc32(u.out);
139
8.90k
}
_Z10hash_crc32IsEmT_
Line
Count
Source
131
8.50k
inline size_t hash_crc32(T key) {
132
8.50k
    union {
133
8.50k
        T in;
134
8.50k
        doris::UInt64 out;
135
8.50k
    } u;
136
8.50k
    u.out = 0;
137
8.50k
    u.in = key;
138
8.50k
    return int_hash_crc32(u.out);
139
8.50k
}
_Z10hash_crc32IiEmT_
Line
Count
Source
131
178k
inline size_t hash_crc32(T key) {
132
178k
    union {
133
178k
        T in;
134
178k
        doris::UInt64 out;
135
178k
    } u;
136
178k
    u.out = 0;
137
178k
    u.in = key;
138
178k
    return int_hash_crc32(u.out);
139
178k
}
_Z10hash_crc32IlEmT_
Line
Count
Source
131
1.02k
inline size_t hash_crc32(T key) {
132
1.02k
    union {
133
1.02k
        T in;
134
1.02k
        doris::UInt64 out;
135
1.02k
    } u;
136
1.02k
    u.out = 0;
137
1.02k
    u.in = key;
138
1.02k
    return int_hash_crc32(u.out);
139
1.02k
}
_Z10hash_crc32ImEmT_
Line
Count
Source
131
4.87M
inline size_t hash_crc32(T key) {
132
4.87M
    union {
133
4.87M
        T in;
134
4.87M
        doris::UInt64 out;
135
4.87M
    } u;
136
4.87M
    u.out = 0;
137
4.87M
    u.in = key;
138
4.87M
    return int_hash_crc32(u.out);
139
4.87M
}
Unexecuted instantiation: _Z10hash_crc32IfEmT_
Unexecuted instantiation: _Z10hash_crc32IdEmT_
_Z10hash_crc32IjEmT_
Line
Count
Source
131
8.66M
inline size_t hash_crc32(T key) {
132
8.66M
    union {
133
8.66M
        T in;
134
8.66M
        doris::UInt64 out;
135
8.66M
    } u;
136
8.66M
    u.out = 0;
137
8.66M
    u.in = key;
138
8.66M
    return int_hash_crc32(u.out);
139
8.66M
}
_Z10hash_crc32ItEmT_
Line
Count
Source
131
20.3k
inline size_t hash_crc32(T key) {
132
20.3k
    union {
133
20.3k
        T in;
134
20.3k
        doris::UInt64 out;
135
20.3k
    } u;
136
20.3k
    u.out = 0;
137
20.3k
    u.in = key;
138
20.3k
    return int_hash_crc32(u.out);
139
20.3k
}
140
141
template <>
142
108k
inline size_t hash_crc32(doris::UInt128 u) {
143
108k
    return doris::UInt128HashCRC32()(u);
144
108k
}
145
146
template <>
147
8
inline size_t hash_crc32(unsigned __int128 u) {
148
8
    return doris::UInt128HashCRC32()(u);
149
8
}
150
151
template <>
152
84
inline size_t hash_crc32(doris::Int128 u) {
153
84
    return doris::UInt128HashCRC32()({(u >> 64) & int64_t(-1), u & int64_t(-1)});
154
84
}
155
156
template <>
157
0
inline size_t hash_crc32(doris::VecDateTimeValue u) {
158
0
    return hash_crc32(*(int64_t*)&u);
159
0
}
160
161
template <>
162
21
inline size_t hash_crc32(doris::DateV2Value<doris::DateTimeV2ValueType> u) {
163
21
    return hash_crc32(u.to_date_int_val());
164
21
}
165
166
template <>
167
1.31k
inline size_t hash_crc32(doris::DateV2Value<doris::DateV2ValueType> u) {
168
1.31k
    return hash_crc32(u.to_date_int_val());
169
1.31k
}
170
171
template <>
172
0
inline size_t hash_crc32(doris::TimestampTzValue u) {
173
0
    return hash_crc32(u.to_date_int_val());
174
0
}
175
176
#define DEFINE_HASH(T)                   \
177
    template <>                          \
178
    struct HashCRC32<T> {                \
179
13.9M
        size_t operator()(T key) const { \
180
13.9M
            return hash_crc32<T>(key);   \
181
13.9M
        }                                \
_ZNK9HashCRC32IhEclEh
Line
Count
Source
179
53.1k
        size_t operator()(T key) const { \
180
53.1k
            return hash_crc32<T>(key);   \
181
53.1k
        }                                \
_ZNK9HashCRC32IaEclEa
Line
Count
Source
179
8.90k
        size_t operator()(T key) const { \
180
8.90k
            return hash_crc32<T>(key);   \
181
8.90k
        }                                \
_ZNK9HashCRC32IsEclEs
Line
Count
Source
179
8.50k
        size_t operator()(T key) const { \
180
8.50k
            return hash_crc32<T>(key);   \
181
8.50k
        }                                \
_ZNK9HashCRC32IiEclEi
Line
Count
Source
179
178k
        size_t operator()(T key) const { \
180
178k
            return hash_crc32<T>(key);   \
181
178k
        }                                \
_ZNK9HashCRC32IlEclEl
Line
Count
Source
179
1.02k
        size_t operator()(T key) const { \
180
1.02k
            return hash_crc32<T>(key);   \
181
1.02k
        }                                \
_ZNK9HashCRC32InEclEn
Line
Count
Source
179
84
        size_t operator()(T key) const { \
180
84
            return hash_crc32<T>(key);   \
181
84
        }                                \
_ZNK9HashCRC32IN4wide7integerILm128EjEEEclES2_
Line
Count
Source
179
108k
        size_t operator()(T key) const { \
180
108k
            return hash_crc32<T>(key);   \
181
108k
        }                                \
_ZNK9HashCRC32ImEclEm
Line
Count
Source
179
4.87M
        size_t operator()(T key) const { \
180
4.87M
            return hash_crc32<T>(key);   \
181
4.87M
        }                                \
Unexecuted instantiation: _ZNK9HashCRC32IfEclEf
Unexecuted instantiation: _ZNK9HashCRC32IdEclEd
_ZNK9HashCRC32IN5doris11DateV2ValueINS0_15DateV2ValueTypeEEEEclES3_
Line
Count
Source
179
1.31k
        size_t operator()(T key) const { \
180
1.31k
            return hash_crc32<T>(key);   \
181
1.31k
        }                                \
_ZNK9HashCRC32IN5doris11DateV2ValueINS0_19DateTimeV2ValueTypeEEEEclES3_
Line
Count
Source
179
21
        size_t operator()(T key) const { \
180
21
            return hash_crc32<T>(key);   \
181
21
        }                                \
Unexecuted instantiation: _ZNK9HashCRC32IN5doris16TimestampTzValueEEclES1_
_ZNK9HashCRC32ItEclEt
Line
Count
Source
179
20.3k
        size_t operator()(T key) const { \
180
20.3k
            return hash_crc32<T>(key);   \
181
20.3k
        }                                \
_ZNK9HashCRC32IjEclEj
Line
Count
Source
179
8.66M
        size_t operator()(T key) const { \
180
8.66M
            return hash_crc32<T>(key);   \
181
8.66M
        }                                \
Unexecuted instantiation: _ZNK9HashCRC32IN5doris16VecDateTimeValueEEclES1_
_ZNK9HashCRC32IoEclEo
Line
Count
Source
179
8
        size_t operator()(T key) const { \
180
8
            return hash_crc32<T>(key);   \
181
8
        }                                \
182
    };
183
184
DEFINE_HASH(doris::UInt8)
185
DEFINE_HASH(doris::UInt16)
186
DEFINE_HASH(doris::UInt32)
187
DEFINE_HASH(doris::UInt64)
188
DEFINE_HASH(doris::UInt128)
189
DEFINE_HASH(doris::Int8)
190
DEFINE_HASH(doris::Int16)
191
DEFINE_HASH(doris::Int32)
192
DEFINE_HASH(doris::Int64)
193
DEFINE_HASH(doris::Int128)
194
DEFINE_HASH(doris::Float32)
195
DEFINE_HASH(doris::Float64)
196
DEFINE_HASH(doris::VecDateTimeValue)
197
DEFINE_HASH(doris::DateV2Value<doris::DateTimeV2ValueType>)
198
DEFINE_HASH(doris::DateV2Value<doris::DateV2ValueType>)
199
DEFINE_HASH(doris::TimestampTzValue)
200
DEFINE_HASH(unsigned __int128)
201
202
#undef DEFINE_HASH
203
204
template <typename Key, typename Hash = HashCRC32<Key>>
205
struct HashMixWrapper {
206
12.3M
    size_t operator()(Key key) const { return phmap::phmap_mix<sizeof(size_t)>()(Hash()(key)); }
_ZNK14HashMixWrapperIm9HashCRC32ImEEclEm
Line
Count
Source
206
4.15M
    size_t operator()(Key key) const { return phmap::phmap_mix<sizeof(size_t)>()(Hash()(key)); }
_ZNK14HashMixWrapperIj9HashCRC32IjEEclEj
Line
Count
Source
206
8.21M
    size_t operator()(Key key) const { return phmap::phmap_mix<sizeof(size_t)>()(Hash()(key)); }
207
};
208
209
template <>
210
struct HashCRC32<doris::UInt256> {
211
88.6k
    size_t operator()(const doris::UInt256& x) const {
212
88.6k
#if defined(__SSE4_2__) || defined(__aarch64__)
213
88.6k
        doris::UInt64 crc = -1ULL;
214
88.6k
        crc = _mm_crc32_u64(crc, x.items[0]);
215
88.6k
        crc = _mm_crc32_u64(crc, x.items[1]);
216
88.6k
        crc = _mm_crc32_u64(crc, x.items[2]);
217
88.6k
        crc = _mm_crc32_u64(crc, x.items[3]);
218
88.6k
        return crc;
219
#else
220
        return Hash128to64({Hash128to64({x.a, x.b}), Hash128to64({x.c, x.d})});
221
#endif
222
88.6k
    }
223
};
224
225
template <>
226
struct HashCRC32<wide::Int256> {
227
8.19k
    size_t operator()(const wide::Int256& x) const {
228
8.19k
#if defined(__SSE4_2__) || defined(__aarch64__)
229
8.19k
        doris::UInt64 crc = -1ULL;
230
8.19k
        crc = _mm_crc32_u64(crc, x.items[0]);
231
8.19k
        crc = _mm_crc32_u64(crc, x.items[1]);
232
8.19k
        crc = _mm_crc32_u64(crc, x.items[2]);
233
8.19k
        crc = _mm_crc32_u64(crc, x.items[3]);
234
8.19k
        return crc;
235
#else
236
        return Hash128to64(
237
                {Hash128to64({x.items[0], x.items[1]}), Hash128to64({x.items[2], x.items[3]})});
238
#endif
239
8.19k
    }
240
};
241
242
template <>
243
struct HashCRC32<doris::Decimal256> {
244
0
    size_t operator()(const doris::Decimal256& value) const {
245
0
        return HashCRC32<wide::Int256>()(value.value);
246
0
    }
247
};
248
249
template <>
250
struct HashCRC32<doris::Decimal32> {
251
0
    size_t operator()(const doris::Decimal32& value) const {
252
0
        return HashCRC32<int32_t>()(value.value);
253
0
    }
254
};
255
256
template <>
257
struct HashCRC32<doris::Decimal64> {
258
0
    size_t operator()(const doris::Decimal64& value) const {
259
0
        return HashCRC32<int64_t>()(value.value);
260
0
    }
261
};
262
263
template <>
264
struct HashCRC32<doris::Decimal128V3> {
265
39
    size_t operator()(const doris::Decimal128V3& value) const {
266
39
        return HashCRC32<__int128>()(value.value);
267
39
    }
268
};
269
270
template <>
271
struct HashCRC32<doris::Decimal128V2> {
272
0
    size_t operator()(const doris::Decimal128V2& value) const {
273
0
        return HashCRC32<__int128>()(value.value);
274
0
    }
275
};
276
277
template <>
278
struct HashCRC32<doris::DecimalV2Value> {
279
0
    size_t operator()(const doris::DecimalV2Value& value) const {
280
0
        return HashCRC32<__int128>()(value.value());
281
0
    }
282
};
283
284
#include "common/compile_check_avoid_begin.h"
285
286
template <>
287
struct HashCRC32<doris::UInt72> {
288
70.4k
    size_t operator()(const doris::UInt72& x) const {
289
70.4k
        doris::UInt64 crc = -1ULL;
290
70.4k
        crc = _mm_crc32_u8(crc, x.a);
291
70.4k
        crc = _mm_crc32_u64(crc, x.b);
292
70.4k
        return crc;
293
70.4k
    }
294
};
295
296
template <>
297
struct HashCRC32<doris::UInt96> {
298
10.5k
    size_t operator()(const doris::UInt96& x) const {
299
10.5k
        doris::UInt64 crc = -1ULL;
300
10.5k
        crc = _mm_crc32_u32(crc, x.a);
301
10.5k
        crc = _mm_crc32_u64(crc, x.b);
302
10.5k
        return crc;
303
10.5k
    }
304
};
305
306
template <>
307
struct HashCRC32<doris::UInt104> {
308
1.39k
    size_t operator()(const doris::UInt104& x) const {
309
1.39k
        doris::UInt64 crc = -1ULL;
310
1.39k
        crc = _mm_crc32_u8(crc, x.a);
311
1.39k
        crc = _mm_crc32_u32(crc, x.b);
312
1.39k
        crc = _mm_crc32_u64(crc, x.c);
313
1.39k
        return crc;
314
1.39k
    }
315
};
316
317
template <>
318
struct HashCRC32<doris::UInt136> {
319
170
    size_t operator()(const doris::UInt136& x) const {
320
170
        doris::UInt64 crc = -1ULL;
321
170
        crc = _mm_crc32_u8(crc, x.a);
322
170
        crc = _mm_crc32_u64(crc, x.b);
323
170
        crc = _mm_crc32_u64(crc, x.c);
324
170
        return crc;
325
170
    }
326
};
327
328
#include "common/compile_check_avoid_end.h"