diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py index 26e93be7b5..5222b6ce8d 100644 --- a/gensrc/script/doris_builtins_functions.py +++ b/gensrc/script/doris_builtins_functions.py @@ -980,10 +980,10 @@ visible_functions = [ [['ceil', 'dceil'], 'DECIMAL32', ['DECIMAL32', 'INT'], ''], [['ceil', 'dceil'], 'DECIMAL64', ['DECIMAL64', 'INT'], ''], [['ceil', 'dceil'], 'DECIMAL128', ['DECIMAL128', 'INT'], ''], + [['truncate'], 'DOUBLE', ['DOUBLE', 'INT'], ''], [['truncate'], 'DECIMAL32', ['DECIMAL32', 'INT'], ''], [['truncate'], 'DECIMAL64', ['DECIMAL64', 'INT'], ''], [['truncate'], 'DECIMAL128', ['DECIMAL128', 'INT'], ''], - [['truncate'], 'DOUBLE', ['DOUBLE', 'INT'], ''], [['ln', 'dlog1'], 'DOUBLE', ['DOUBLE'], 'ALWAYS_NULLABLE'], [['log'], 'DOUBLE', ['DOUBLE', 'DOUBLE'], 'ALWAYS_NULLABLE'], diff --git a/regression-test/data/query_p0/sql_functions/math_functions/test_round.out b/regression-test/data/query_p0/sql_functions/math_functions/test_round.out index 3f2ff0ab96..a847c8b2a9 100644 --- a/regression-test/data/query_p0/sql_functions/math_functions/test_round.out +++ b/regression-test/data/query_p0/sql_functions/math_functions/test_round.out @@ -11,6 +11,11 @@ -- !select -- 10.12 +-- !truncate -- +1.0 1989.0 1001.0 123.1 0.1 6.3 +2.0 1986.0 1001.0 1243.5 20.2 789.2 +3.0 1989.0 1002.0 24453.3 78945.0 3654.0 + -- !select -- 16.000 16.00000 16.00000 diff --git a/regression-test/suites/query_p0/sql_functions/math_functions/test_round.groovy b/regression-test/suites/query_p0/sql_functions/math_functions/test_round.groovy index d56cd0fac4..b30f35f78a 100644 --- a/regression-test/suites/query_p0/sql_functions/math_functions/test_round.groovy +++ b/regression-test/suites/query_p0/sql_functions/math_functions/test_round.groovy @@ -21,6 +21,9 @@ suite("test_round") { qt_select "SELECT round_bankers(10.12345)" qt_select "SELECT round_bankers(10.12345, 2)" + def tableTest = "test_query_db.test" + qt_truncate "select truncate(k1, 1), truncate(k2, 1), truncate(k3, 1), truncate(k5, 1), truncate(k8, 1), truncate(k9, 1) from ${tableTest} order by 1;" + def tableName = "test_round" sql """DROP TABLE IF EXISTS `${tableName}`""" sql """ CREATE TABLE `${tableName}` (