diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java index 57eda59ee7..1368d8adcf 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/NumericArithmetic.java @@ -1050,7 +1050,7 @@ public class NumericArithmetic { /** * tanh */ - @ExecFunction(name = "cosh") + @ExecFunction(name = "tanh") public static Expression tanh(DoubleLiteral first) { return checkOutputBoundary(new DoubleLiteral(Math.tanh(first.getValue()))); } diff --git a/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_numeric_arithmatic.groovy b/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_numeric_arithmatic.groovy index bc1cb91ca9..7aa09d8a18 100644 --- a/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_numeric_arithmatic.groovy +++ b/regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_numeric_arithmatic.groovy @@ -470,6 +470,9 @@ suite("fold_constant_numeric_arithmatic") { testFoldConst("SELECT TANH(0) AS tanh_case_1") //tanh(0) = 0 testFoldConst("SELECT TANH(1) AS tanh_case_2") //tanh(1) testFoldConst("SELECT TANH(-1) AS tanh_case_3") //tanh(-1) + testFoldConst("SELECT TANH(NULL)") + testFoldConst("SELECT TANH(-0.5), TANH(0.5), TANH(10), TANH(-10)") + testFoldConst("SELECT TANH(-20), TANH(20), TANH(1E-7), TANH(-1E-7)") //Truncate function cases testFoldConst("SELECT TRUNCATE(123.456, 2) AS truncate_case_1") //truncate(123.456, 2) = 123.45