Skip to content

Commit d95780d

Browse files
committed
add fix with another hash function (dirty)
1 parent 50b7b63 commit d95780d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ydb/library/yql/minikql/comp_nodes/mkql_wide_combine.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include <util/string/cast.h>
1818

19+
#include <contrib/libs/xxhash/xxhash.h>
20+
1921
namespace NKikimr {
2022
namespace NMiniKQL {
2123

@@ -485,7 +487,8 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
485487
}
486488

487489
auto hash = Hasher(ViewForKeyAndState.data());
488-
auto bucketId = hash % SpilledBucketCount;
490+
XXH64_hash_t hashed_hash = XXH64(&hash, sizeof(hash), 0);
491+
auto bucketId = hashed_hash % SpilledBucketCount;
489492
auto& bucket = SpilledBuckets[bucketId];
490493

491494
if (bucket.BucketState == TSpilledBucket::EBucketState::InMemory) {
@@ -592,8 +595,9 @@ class TSpillingSupportState : public TComputationValue<TSpillingSupportState> {
592595
SplitStateSpillingBucket = -1;
593596
}
594597
while (const auto keyAndState = static_cast<NUdf::TUnboxedValue *>(InMemoryProcessingState.Extract())) {
595-
auto hash = Hasher(keyAndState); //Hasher uses only key for hashing
596-
auto bucketId = hash % SpilledBucketCount;
598+
auto hash = Hasher(keyAndState); //Hasher uses only key for hashing
599+
XXH64_hash_t hashed_hash = XXH64(&hash, sizeof(hash), 0);
600+
auto bucketId = hashed_hash % SpilledBucketCount;
597601
auto& bucket = SpilledBuckets[bucketId];
598602

599603
bucket.LineCount++;

0 commit comments

Comments
 (0)