This is an automated email from the ASF dual-hosted git repository. lihaopeng pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new fb344b66cae [fix](hash join) fix numeric overflow when calculating hash table bucket size #37193 (#37213) fb344b66cae is described below commit fb344b66caefe32a07d7d175f54802652fc853a2 Author: TengJianPing <18241664+jackte...@users.noreply.github.com> AuthorDate: Thu Jul 4 11:12:52 2024 +0800 [fix](hash join) fix numeric overflow when calculating hash table bucket size #37193 (#37213) ## Proposed changes Bp #37193 --- be/src/vec/common/hash_table/join_hash_table.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 a869ad419ad..99ce2d13b48 100644 --- a/be/src/vec/common/hash_table/join_hash_table.h +++ b/be/src/vec/common/hash_table/join_hash_table.h @@ -19,6 +19,8 @@ #include <gen_cpp/PlanNodes_types.h> +#include <limits> + #include "vec/columns/column_filter_helper.h" #include "vec/common/hash_table/hash.h" #include "vec/common/hash_table/hash_table.h" @@ -35,7 +37,8 @@ public: static uint32_t calc_bucket_size(size_t num_elem) { size_t expect_bucket_size = num_elem + (num_elem - 1) / 7; - return phmap::priv::NormalizeCapacity(expect_bucket_size) + 1; + return std::min(phmap::priv::NormalizeCapacity(expect_bucket_size) + 1, + static_cast<size_t>(std::numeric_limits<uint32_t>::max())); } size_t get_byte_size() const { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org