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

zykkk 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 864ebb82d19 [fix](compile) Fix MacOS compile failed (#44901)
864ebb82d19 is described below

commit 864ebb82d196e8d831c955a33821144193d412da
Author: Xinyi Zou <zouxi...@selectdb.com>
AuthorDate: Wed Dec 4 14:31:16 2024 +0800

    [fix](compile) Fix MacOS compile failed (#44901)
---
 be/src/vec/columns/column_decimal.h                   | 2 +-
 be/src/vec/columns/column_vector.cpp                  | 2 +-
 be/src/vec/functions/array/function_array_shuffle.cpp | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/be/src/vec/columns/column_decimal.h 
b/be/src/vec/columns/column_decimal.h
index a8b1f9573ef..dde7a1c6237 100644
--- a/be/src/vec/columns/column_decimal.h
+++ b/be/src/vec/columns/column_decimal.h
@@ -259,7 +259,7 @@ protected:
         for (U i = 0; i < s; ++i) res[i] = i;
 
         auto sort_end = res.end();
-        if (limit && limit < static_cast<double>(s) / 8.0L) {
+        if (limit && static_cast<double>(limit) < static_cast<double>(s) / 
8.0) {
             sort_end = res.begin() + limit;
             if (reverse)
                 std::partial_sort(res.begin(), sort_end, res.end(),
diff --git a/be/src/vec/columns/column_vector.cpp 
b/be/src/vec/columns/column_vector.cpp
index f0f0bec8b99..396edcc2ad4 100644
--- a/be/src/vec/columns/column_vector.cpp
+++ b/be/src/vec/columns/column_vector.cpp
@@ -243,7 +243,7 @@ void ColumnVector<T>::get_permutation(bool reverse, size_t 
limit, int nan_direct
     if (s == 0) return;
 
     // std::partial_sort need limit << s can get performance benefit
-    if (limit > (s / 8.0L)) limit = 0;
+    if (static_cast<double>(limit) > (static_cast<double>(s) / 8.0)) limit = 0;
 
     if (limit) {
         for (size_t i = 0; i < s; ++i) res[i] = i;
diff --git a/be/src/vec/functions/array/function_array_shuffle.cpp 
b/be/src/vec/functions/array/function_array_shuffle.cpp
index fbf5bcfcdf1..b9e3206ba0b 100644
--- a/be/src/vec/functions/array/function_array_shuffle.cpp
+++ b/be/src/vec/functions/array/function_array_shuffle.cpp
@@ -79,7 +79,8 @@ public:
             seed = assert_cast<const 
ColumnInt64*>(seed_column.get())->get_element(0);
         }
 
-        std::mt19937 g(seed);
+        // time() and seed will not exceed the range of uint32.
+        std::mt19937 g(cast_set<uint32>(seed));
         auto dest_column_ptr = _execute(src_column_array, g);
         if (!dest_column_ptr) {
             return Status::RuntimeError(


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to