This is an automated email from the ASF dual-hosted git repository. yiguolei 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 2e29b15c6a [test](array function)add array_range function test (#14123) 2e29b15c6a is described below commit 2e29b15c6ac56dcf5986adbb2b47033dc4e090fe Author: zy-kkk <zhong...@qq.com> AuthorDate: Fri Nov 11 18:04:33 2022 +0800 [test](array function)add array_range function test (#14123) * add array_range function test * add array_range function test --- .../array_functions/test_array_functions.out | 39 ++++++++++++++++++++++ .../array_functions/test_array_functions.groovy | 31 +++++++++++++++++ 2 files changed, 70 insertions(+) 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 bf80ca4ab7..4bb260669c 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 @@ -215,3 +215,42 @@ 6 \N 7 \N +-- !select -- +\N \N +-1 \N +1 [0] +2 [0, 1] +3 [0, 1, 2] +4 [0, 1, 2, 3] +5 [0, 1, 2, 3, 4] +6 [0, 1, 2, 3, 4, 5] +7 [0, 1, 2, 3, 4, 5, 6] +8 [0, 1, 2, 3, 4, 5, 6, 7] +9 [0, 1, 2, 3, 4, 5, 6, 7, 8] + +-- !select -- +\N \N +-1 \N +1 [1, 2] +2 [2, 3, 4, 5, 6, 7, 8, 9] +3 \N +4 [4, 5] +5 [5, 6, 7, 8, 9] +6 \N +7 [7, 8, 9] +8 [] +9 [9] + +-- !select -- +\N \N +-1 \N +1 [1] +2 [2, 4, 6, 8] +3 \N +4 [4, 5] +5 [5, 6, 7, 8, 9] +6 \N +7 \N +8 [] +9 [9] + 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 965b132cc4..156b9c491b 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 @@ -70,4 +70,35 @@ suite("test_array_functions") { qt_select "SELECT k1, array_popback(k5) from ${tableName} ORDER BY k1" qt_select "SELECT k1, array_popback(k6) from ${tableName} ORDER BY k1" qt_select "SELECT k1, array_popback(k7) from ${tableName} ORDER BY k1" + + def tableName2 = "tbl_test_array_range" + sql """DROP TABLE IF EXISTS ${tableName2}""" + sql """ + CREATE TABLE IF NOT EXISTS ${tableName2} ( + `k1` int(11) NULL COMMENT "", + `k2` int(11) NULL COMMENT "", + `k3` int(11) NULL COMMENT "" + ) ENGINE=OLAP + DUPLICATE KEY(`k1`) + DISTRIBUTED BY HASH(`k1`) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "storage_format" = "V2" + ) + """ + sql """ INSERT INTO ${tableName2} VALUES(-1,3,5) """ + sql """ INSERT INTO ${tableName2} VALUES(1,3,5) """ + sql """ INSERT INTO ${tableName2} VALUES(2,10,2) """ + sql """ INSERT INTO ${tableName2} VALUES(3,NULL,NULL) """ + sql """ INSERT INTO ${tableName2} VALUES(4,6,1) """ + sql """ INSERT INTO ${tableName2} VALUES(5,10,1) """ + sql """ INSERT INTO ${tableName2} VALUES(6,NULL,1) """ + sql """ INSERT INTO ${tableName2} VALUES(7,10,NULL) """ + sql """ INSERT INTO ${tableName2} VALUES(NULL,10,2) """ + sql """ INSERT INTO ${tableName2} VALUES(8,2,2) """ + sql """ INSERT INTO ${tableName2} VALUES(9,10,6) """ + + qt_select "SELECT k1, array_range(k1) from ${tableName2} ORDER BY k1" + qt_select "SELECT k1, array_range(k1,k2) from ${tableName2} ORDER BY k1" + qt_select "SELECT k1, array_range(k1,k2,k3) from ${tableName2} ORDER BY k1" } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org