diff --git a/be/src/vec/exec/vsort_node.cpp b/be/src/vec/exec/vsort_node.cpp index 79af7c8c0b76a8..734af91baac45a 100644 --- a/be/src/vec/exec/vsort_node.cpp +++ b/be/src/vec/exec/vsort_node.cpp @@ -84,6 +84,7 @@ Status VSortNode::get_next(RuntimeState* state, Block* block, bool* eos) { _sorted_blocks[0].skip_num_rows(_offset); } block->swap(_sorted_blocks[0]); + *eos = true; } else { RETURN_IF_ERROR(merge_sort_read(state, block, eos)); } diff --git a/be/src/vec/functions/math.cpp b/be/src/vec/functions/math.cpp index af482775097504..57d6c48b0e49f6 100644 --- a/be/src/vec/functions/math.cpp +++ b/be/src/vec/functions/math.cpp @@ -258,14 +258,7 @@ struct NegativeImpl { using ResultType = A; static inline ResultType apply(A a) { - if constexpr (IsDecimalNumber) - return a > 0 ? A(-a) : a; - else if constexpr (std::is_integral_v && std::is_signed_v) - return a > 0 ? static_cast(~a) + 1 : a; - else if constexpr (std::is_integral_v && std::is_unsigned_v) - return static_cast(-a); - else if constexpr (std::is_floating_point_v) - return static_cast(-std::abs(a)); + return -a; } }; diff --git a/be/test/vec/function/function_math_test.cpp b/be/test/vec/function/function_math_test.cpp index f56ab7d4d91c31..0413abdfb66db5 100644 --- a/be/test/vec/function/function_math_test.cpp +++ b/be/test/vec/function/function_math_test.cpp @@ -296,7 +296,7 @@ TEST(MathFunctionTest, negative_test) { { std::vector input_types = {vectorized::TypeIndex::Float64}; - DataSet data_set = {{{0.0123}, -0.0123}, {{90.45}, -90.45}, {{0.0}, 0.0}, {{-60.0}, -60.0}}; + DataSet data_set = {{{0.0123}, -0.0123}, {{90.45}, -90.45}, {{0.0}, 0.0}, {{-60.0}, 60.0}}; vectorized::check_function(func_name, input_types, data_set);