This is an automated email from the ASF dual-hosted git repository. gabriellee pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new bb12a1cb49 [Enhance](array function) add support for DecimalV3 for array_enumerate_uniq() (#17724) bb12a1cb49 is described below commit bb12a1cb49e55aa9c55ca0fd0a12d6683087f0ae Author: bobhan1 <bh2444151...@outlook.com> AuthorDate: Tue May 30 13:09:19 2023 +0800 [Enhance](array function) add support for DecimalV3 for array_enumerate_uniq() (#17724) --- be/src/vec/functions/array/function_array_enumerate_uniq.cpp | 6 ++++++ .../sql_functions/array_functions/test_array_functions.out | 11 +++++++++++ .../array_functions/test_array_functions_by_literal.out | 3 +++ .../sql_functions/array_functions/test_array_functions.groovy | 1 + .../array_functions/test_array_functions_by_literal.groovy | 3 ++- 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/be/src/vec/functions/array/function_array_enumerate_uniq.cpp b/be/src/vec/functions/array/function_array_enumerate_uniq.cpp index 3ca1084bf2..d40185f903 100644 --- a/be/src/vec/functions/array/function_array_enumerate_uniq.cpp +++ b/be/src/vec/functions/array/function_array_enumerate_uniq.cpp @@ -181,6 +181,12 @@ public: _execute_number<ColumnDateTime>(data_columns, *offsets, null_map, dst_values); } else if (which.is_date_v2()) { _execute_number<ColumnDateV2>(data_columns, *offsets, null_map, dst_values); + } else if (which.is_decimal32()) { + _execute_number<ColumnDecimal32>(data_columns, *offsets, null_map, dst_values); + } else if (which.is_decimal64()) { + _execute_number<ColumnDecimal64>(data_columns, *offsets, null_map, dst_values); + } else if (which.is_decimal128i()) { + _execute_number<ColumnDecimal128I>(data_columns, *offsets, null_map, dst_values); } else if (which.is_date_time_v2()) { _execute_number<ColumnDateTimeV2>(data_columns, *offsets, null_map, dst_values); } else if (which.is_decimal128()) { diff --git a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out index 5baa3e7e09..6b27390557 100644 --- a/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out +++ b/regression-test/data/query_p0/sql_functions/array_functions/test_array_functions.out @@ -692,6 +692,17 @@ 8 \N 9 \N +-- !select -- +1 [1, 1] +2 [1, 1] +3 \N +4 \N +5 \N +6 \N +7 \N +8 \N +9 \N + -- !select_array_shuffle1 -- 1 [1, 2, 3] 6 6 [3, 2, 1] [3, 2, 1] 2 [4] 4 4 [4] [4] 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 8d5f066854..8f9cf62b17 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 @@ -779,6 +779,9 @@ _ -- !sql -- [1, 1, 2] +-- !sql -- +[1, 1, 2, 1, 3] + -- !sql -- [1, 1, 1, 1, 1] diff --git a/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy b/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy index 6111e7a717..6ccd9f73c1 100644 --- a/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy +++ b/regression-test/suites/query_p0/sql_functions/array_functions/test_array_functions.groovy @@ -115,6 +115,7 @@ suite("test_array_functions") { qt_select "SELECT k1, array_enumerate_uniq(k7) from ${tableName} ORDER BY k1" qt_select "SELECT k1, array_enumerate_uniq(k8) from ${tableName} ORDER BY k1" qt_select "SELECT k1, array_enumerate_uniq(k10) from ${tableName} ORDER BY k1" + qt_select "SELECT k1, array_enumerate_uniq(k12) from ${tableName} ORDER BY k1" qt_select_array_shuffle1 "SELECT k1, k2, array_sum(k2), array_sum(array_shuffle(k2)), array_shuffle(k2, 0), shuffle(k2, 0) from ${tableName} ORDER BY k1" qt_select_array_shuffle2 "SELECT k1, k5, array_size(k5), array_size(array_shuffle(k5)), array_shuffle(k5, 0), shuffle(k5, 0) from ${tableName} ORDER BY k1" qt_select_array_shuffle3 "SELECT k1, k6, array_size(k6), array_size(array_shuffle(k6)), array_shuffle(k6, 0), shuffle(k6, 0) from ${tableName} ORDER BY k1" 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 e22b2a324f..35ca5f3cd9 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 @@ -316,13 +316,14 @@ suite("test_array_functions_by_literal") { qt_sql "select array_enumerate_uniq(['11', '22', '33', '11', '33', '22'])" qt_sql "select array_enumerate_uniq(array(cast (24.99 as decimal(10,3)), cast (25.99 as decimal(10,3)), cast (24.99 as decimal(10,3))))" qt_sql "select array_enumerate_uniq(array(cast ('2023-02-06 22:07:34.999' as datetimev2(3)), cast ('2023-02-04 23:07:34.999' as datetimev2(3)), cast ('2023-02-06 22:07:34.999' as datetimev2(3))))" + qt_sql "select array_enumerate_uniq(array(cast (384.2933 as decimalv3(7, 4)), cast (984.1913 as decimalv3(7, 4)), cast (384.2933 as decimalv3(7, 4)), cast (722.9333 as decimalv3(7, 4)), cast (384.2933 as decimalv3(7, 4))))" qt_sql "select array_enumerate_uniq([1, 2, 3, 4, 5], [1, 2, 3, 4, 5])" qt_sql "select array_enumerate_uniq([1, 1, 1, 1, 1], [1, 1, 1, 1, 1])" qt_sql "select array_enumerate_uniq([1, 1, 1, 1, 1], [1, 1, 1, 1, 1])" qt_sql "select array_enumerate_uniq([1, 1, 2, 2, 1, 2], [1, 2, 1, 2, 2, 1])" qt_sql "select array_enumerate_uniq([1, null, 1, null], [null, 1, null, 1])" qt_sql "select array_enumerate_uniq([1, 1, 1, 1, 1, 1], [2, 1, 2, 1, 2, 1], [3, 1, 3, 1, 3, 1])" - qt_sql "select array_enumerate_uniq([1, 3, 1], [2.0, 5.0, 2.0], ['3', '8', '3'])" + qt_sql "select array_enumerate_uniq([1, 3, 1], [2.0, 5.0, 2.0], ['3', '8', '3'], array(cast (34.9876 as decimalv3(6, 4)), cast (89.9865 as decimalv3(6, 4)), cast (34.9876 as decimalv3(6, 4))))" // array_pushfront qt_sql "select array_pushfront([1, 2, 3], 6)" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org