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 1a3ec4149d22273..f83c9ce9674c0a5 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 @@ -1669,10 +1669,6 @@ && collectChildReturnTypes()[0].isDecimalV3()) { || fnName.getFunction().equalsIgnoreCase("hist")) && children.get(0).getType().isDecimalV3() && args[ix].isDecimalV3()) { continue; - } else if (fnName.getFunction().equalsIgnoreCase("array") - && (children.get(0).getType().isDecimalV3() && args[ix].isDecimalV3() - || children.get(0).getType().isDatetimeV2() && args[ix].isDatetimeV2())) { - continue; } else if ((fnName.getFunction().equalsIgnoreCase("array_min") || fnName.getFunction() .equalsIgnoreCase("array_max") || fnName.getFunction().equalsIgnoreCase("element_at")) && (( 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 63103fa437f73c3..8e69544962f6fc7 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 @@ -2,6 +2,54 @@ -- !sql -- [1, 1, 2, 2, 2, 2] +-- !sql_1 -- +[1.0, 2.0, NULL, NULL, 2.0] + +-- !sql_1 -- +["a", "2.0", NULL, NULL, "2.0"] + +-- !sql_1 -- +[1, 2, NULL, NULL, 2] + +-- !sql_2 -- +[NULL, NULL, 1.0, 2.0, 2.0] + +-- !sql_3 -- +1.0 + +-- !sql_4 -- +2.0 + +-- !sql_5 -- +1.6 + +-- !sql_6 -- +5.0 + +-- !sql_7 -- +4.0 + +-- !sql_8 -- +[1.0, 2.0, NULL] + +-- !sql_9 -- +[NULL, 1.0, 2.0] + +-- !sql_10 -- +[] + +-- !sql_11 -- +[1.0, 2.0, NULL] + +-- !sql_14 -- +[2.0, NULL, NULL, 2.0] + +-- !sql_15 -- +[1.0, 2.0, NULL, NULL] + +-- !sql_16 -- +[1.0, 2.0, NULL, NULL, 2.0, 1.0, 2.0, NULL, NULL, 2.0] + -- !sql -- true 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 d969312431402cc..d541d2447022b41 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 @@ -19,6 +19,24 @@ suite("test_array_functions_by_literal") { // array_nested function qt_sql "select a from (select array(1, 1, 2, 2, 2, 2) as a) t" + // array with decimal and other types + qt_sql_1 """select array(1.0,2.0,null, null,2.0);""" + qt_sql_1 """select array('a',2.0,null, null,2.0);""" + qt_sql_1 """select array(1,2.0,null, null,2.0);""" + qt_sql_2 """select array_sort(array(1.0,2.0,null, null,2.0));""" + qt_sql_3 """select array_min(array(1.0,2.0,null, null,2.0));""" + qt_sql_4 """select array_max(array(1.0,2.0,null, null,2.0));""" + qt_sql_5 """select array_avg(array(1.0,2.0,null, null,2.0));""" + qt_sql_6 """select array_sum(array(1.0,2.0,null, null,2.0));""" + qt_sql_7 """select array_product(array(1.0,2.0,null, null,2.0));""" + qt_sql_8 """select array_distinct(array(1.0,2.0,null, null,2.0));""" + qt_sql_9 """select array_intersect(array(1.0,2.0,null, null,2.0), array(1.0,2.0,null, null,2.0));""" + qt_sql_10 """select array_except(array(1.0,2.0,null, null,2.0), array(1.0,2.0,null, null,2.0));""" + qt_sql_11 """select array_union(array(1.0,2.0,null, null,2.0), array(1.0,2.0,null, null,2.0));""" + qt_sql_14 """select array_popfront(array(1.0,2.0,null, null,2.0));""" + qt_sql_15 """select array_popback(array(1.0,2.0,null, null,2.0));""" + qt_sql_16 """select array_concat(array(1.0,2.0,null, null,2.0), array(1.0,2.0,null, null,2.0));""" + // array_contains function qt_sql "select array_contains([1,2,3], 1)"