diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java index bd502d85faa0ec..7d041959563807 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java @@ -1862,6 +1862,9 @@ && collectChildReturnTypes()[0].isDecimalV3()) { || fnName.getFunction().equalsIgnoreCase("array_shuffle") || fnName.getFunction().equalsIgnoreCase("shuffle") || fnName.getFunction().equalsIgnoreCase("array_except") + || fnName.getFunction().equalsIgnoreCase("array_apply") + || fnName.getFunction().equalsIgnoreCase("array_position") + || fnName.getFunction().equalsIgnoreCase("array_contains") || fnName.getFunction().equalsIgnoreCase("width_bucket")) && (args[ix].isDecimalV3() || (children.get(0).getType().isArrayType() && (((ArrayType) children.get(0).getType()).getItemType().isDecimalV3()) diff --git a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out index bc2b454a33df87..b233d6620a8b99 100644 --- a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out +++ b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions_by_literal.out @@ -53,6 +53,9 @@ -- !sql -- true +-- !sql -- +true + -- !sql -- false @@ -86,6 +89,9 @@ true -- !sql -- true +-- !sql -- +2 + -- !sql -- 1 @@ -732,7 +738,7 @@ _ [1000002] -- !sql -- -[1.111, 2.222, 3.333] +[2.222, 3.333] -- !sql -- ["2022-01-03 00:00:00", "2021-01-01 00:00:00"] diff --git a/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions_by_literal.groovy b/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions_by_literal.groovy index 2700cb62bc799b..8c381e0d9a22db 100644 --- a/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions_by_literal.groovy +++ b/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions_by_literal.groovy @@ -40,6 +40,7 @@ suite("test_array_functions_by_literal") { // array_contains function + qt_sql "select array_contains([1.111, 2, 3.333], 2);" qt_sql "select array_contains([1,2,3], 1)" qt_sql "select array_contains([1,2,3], 4)" qt_sql "select array_contains([1,2,3,NULL], 1)" @@ -54,6 +55,7 @@ suite("test_array_functions_by_literal") { qt_sql "select array_contains(array(cast (111.111 as decimalv3(6,3)),cast (222.222 as decimalv3(6,3))), cast (111.111 as decimalv3(6,3)))" // array_position function + qt_sql "select array_position([1.111, 2, 3.333], 2);" qt_sql "select array_position([1,2,3], 1)" qt_sql "select array_position([1,2,3], 3)" qt_sql "select array_position([1,2,3], 4)"