This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 2344aaf33771ff24f0ae7152fc93f532753bcfc0
Author: Jerry Hu <[email protected]>
AuthorDate: Mon Feb 5 16:08:49 2024 +0800

    [fix](join) JoinHashTable::pre_build_idxs should be const (#30837)
---
 be/src/vec/common/hash_table/join_hash_table.h | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/be/src/vec/common/hash_table/join_hash_table.h 
b/be/src/vec/common/hash_table/join_hash_table.h
index 5ae0a13acef..d2d6dfc2ed9 100644
--- a/be/src/vec/common/hash_table/join_hash_table.h
+++ b/be/src/vec/common/hash_table/join_hash_table.h
@@ -234,17 +234,16 @@ public:
 
     bool has_null_key() { return _has_null_key; }
 
-    void pre_build_idxs(std::vector<uint32>& buckets, const uint8_t* null_map) 
{
-        const auto first_at_bucket_size = first[bucket_size];
+    void pre_build_idxs(std::vector<uint32>& buckets, const uint8_t* null_map) 
const {
         if (null_map) {
-            first[bucket_size] = bucket_size; // distinguish between not 
matched and null
-        }
-
-        for (unsigned int& bucket : buckets) {
-            bucket = first[bucket];
+            for (unsigned int& bucket : buckets) {
+                bucket = bucket == bucket_size ? bucket_size : first[bucket];
+            }
+        } else {
+            for (unsigned int& bucket : buckets) {
+                bucket = first[bucket];
+            }
         }
-
-        first[bucket_size] = first_at_bucket_size;
     }
 
 private:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to