From 0e6ceb821a5fa0d0a4caa8b79c8e8577ce8ea21b Mon Sep 17 00:00:00 2001 From: githubgxll <1094462054@qq.com> Date: Tue, 6 Jan 2026 15:34:02 +0800 Subject: [PATCH] [fix][runtime] Fixed the round function's decimal place limit to be between -30 and 30 --- .../io/dingodb/expr/runtime/op/mathematical/Round2Fun.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical/Round2Fun.java b/runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical/Round2Fun.java index 855ffd3e..ef86dbe9 100644 --- a/runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical/Round2Fun.java +++ b/runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical/Round2Fun.java @@ -57,7 +57,7 @@ static double round(double value, int scale) { } static @NonNull BigDecimal round(@NonNull BigDecimal value, int scale) { - if (-10 <= scale && scale <= 10) { + if (-30 <= scale && scale <= 30) { BigDecimal result = value.setScale(scale, RoundingMode.HALF_UP); if (scale < 0) { result = result.setScale(0, RoundingMode.HALF_UP); @@ -65,7 +65,7 @@ static double round(double value, int scale) { return result; } throw new ExprEvaluatingException( - new ArithmeticException("Scale of " + NAME + " function must be in range [-10, 10].") + new ArithmeticException("Scale of " + NAME + " function must be in range [-30, 30].") ); }