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

mrhhsg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 80dfb66f9df [fix](join) JoinHashTable::pre_build_idxs should be const 
(#30837)
80dfb66f9df is described below

commit 80dfb66f9df6bfea8594616aacc2098632d58651
Author: Jerry Hu <mrh...@gmail.com>
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: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to