diff --git a/be/src/vec/functions/random.cpp b/be/src/vec/functions/random.cpp index 817fa5e94b8343f..fb6d9c60a53c4e7 100644 --- a/be/src/vec/functions/random.cpp +++ b/be/src/vec/functions/random.cpp @@ -72,7 +72,7 @@ class Random : public IFunction { if (!context->is_col_constant(0)) { return Status::InvalidArgument("The param of rand function must be literal"); } - int64_t seed = 0; + uint64_t seed = 0; if (!context->get_constant_col(0)->column_ptr->is_null_at(0)) { seed = (*context->get_constant_col(0)->column_ptr)[0].get(); } diff --git a/be/test/vec/function/function_math_test.cpp b/be/test/vec/function/function_math_test.cpp index bb24d141e4c3be5..d04b83433888a65 100644 --- a/be/test/vec/function/function_math_test.cpp +++ b/be/test/vec/function/function_math_test.cpp @@ -441,8 +441,8 @@ TEST(MathFunctionTest, random_test) { {{(int64_t)0}, 0.15979336337046085}, {{(int64_t)10}, 0.60128310734097479}, {{(int64_t)123}, 0.31320017867847078}, - {{(int64_t)std::numeric_limits::max()}, 0.20676730979843233}, - {{(int64_t)std::numeric_limits::min()}, 0.15979336337046085}}; + {{(int64_t)std::numeric_limits::max()}, 0.54774821662127238}, + {{(int64_t)std::numeric_limits::min()}, 0.75146173420574858}}; for (const auto& data : data_set) { DataSet data_line = {data};