diff --git a/velox/exec/HashTable.cpp b/velox/exec/HashTable.cpp index 02ff92e688c1..feb7e1fd6e42 100644 --- a/velox/exec/HashTable.cpp +++ b/velox/exec/HashTable.cpp @@ -231,8 +231,8 @@ class ProbeState { return group_; } const auto kEmptyGroup = BaseHashTable::TagVector::broadcast(kEmptyTag); - for (int64_t numProbedBuckets = 0; numProbedBuckets < table.numBuckets(); - ++numProbedBuckets) { + int64_t numProbedBuckets = 0; + while (numProbedBuckets < table.numBuckets()) { if (!hits_) { const uint16_t empty = simd::toBitMask(tagsInTable_ == kEmptyGroup); if (empty) { @@ -248,6 +248,7 @@ class ProbeState { continue; } bucketOffset_ = table.nextBucketOffset(bucketOffset_); + ++numProbedBuckets; tagsInTable_ = BaseHashTable::loadTags( reinterpret_cast(table.table_), bucketOffset_); hits_ = simd::toBitMask(tagsInTable_ == wantedTags_) & kFullMask;