From 94f75ff53d08076513d8cb3935b02c33645e7696 Mon Sep 17 00:00:00 2001 From: jacktengg <18241664+jacktengg@users.noreply.github.com> Date: Mon, 23 Oct 2023 10:42:19 +0800 Subject: [PATCH] [fix](regression) fix regression framework bug: if real test result is negative, it will miss check test result --- be/src/vec/functions/function_binary_arithmetic.h | 3 ++- .../groovy/org/apache/doris/regression/util/OutputUtils.groovy | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/be/src/vec/functions/function_binary_arithmetic.h b/be/src/vec/functions/function_binary_arithmetic.h index 7198a08bb222ec..911704718fb1e6 100644 --- a/be/src/vec/functions/function_binary_arithmetic.h +++ b/be/src/vec/functions/function_binary_arithmetic.h @@ -79,7 +79,8 @@ struct OperationTraits { std::is_same_v>; static constexpr bool can_overflow = (is_plus_minus || is_multiply) && - (IsDecimalV2 || IsDecimalV2 || IsDecimal256 || IsDecimal256); + (IsDecimalV2 || IsDecimalV2 || IsDecimal128I || IsDecimal128I || + IsDecimal256 || IsDecimal256); static constexpr bool has_variadic_argument = !std::is_void_v()))>; }; diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy index 757a4a593f8cc2..b140673e7a762e 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/util/OutputUtils.groovy @@ -76,7 +76,7 @@ class OutputUtils { double expectDouble = Double.parseDouble(expectCell) double realDouble = Double.parseDouble(realCell) - double realRelativeError = Math.abs(expectDouble - realDouble) / realDouble + double realRelativeError = Math.abs(expectDouble - realDouble) / Math.abs(realDouble) double expectRelativeError = 1e-8 if (expectRelativeError < realRelativeError) {