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 9d9fcca40c [regression-test](array)add test for array_slice (#11329)
9d9fcca40c is described below

commit 9d9fcca40cc347bbd4153efce5131a61d4e9d1bd
Author: xy720 <[email protected]>
AuthorDate: Sat Jul 30 09:59:58 2022 +0800

    [regression-test](array)add test for array_slice (#11329)
---
 .../test_array_functions_by_literal.out            | 24 ++++++++++++++++++++++
 .../test_array_functions_by_literal.groovy         | 10 +++++++++
 2 files changed, 34 insertions(+)

diff --git 
a/regression-test/data/query/sql_functions/array_functions/test_array_functions_by_literal.out
 
b/regression-test/data/query/sql_functions/array_functions/test_array_functions_by_literal.out
index 406ff361fa..7d447e1943 100644
--- 
a/regression-test/data/query/sql_functions/array_functions/test_array_functions_by_literal.out
+++ 
b/regression-test/data/query/sql_functions/array_functions/test_array_functions_by_literal.out
@@ -190,3 +190,27 @@ true
 
 -- !sql --
 [2, 3]
+
+-- !sql --
+[1]
+
+-- !sql --
+[1, 2, 3]
+
+-- !sql --
+[1, 2, 3]
+
+-- !sql --
+[2, 3]
+
+-- !sql --
+[2, 3]
+
+-- !sql --
+[]
+
+-- !sql --
+[]
+
+-- !sql --
+[]
diff --git 
a/regression-test/suites/query/sql_functions/array_functions/test_array_functions_by_literal.groovy
 
b/regression-test/suites/query/sql_functions/array_functions/test_array_functions_by_literal.groovy
index a7b73fd5e7..47230d32c0 100644
--- 
a/regression-test/suites/query/sql_functions/array_functions/test_array_functions_by_literal.groovy
+++ 
b/regression-test/suites/query/sql_functions/array_functions/test_array_functions_by_literal.groovy
@@ -102,4 +102,14 @@ suite("test_array_functions_by_literal", "all") {
     qt_sql "select array_union([1,2,3], [2,3,4,null])"
     qt_sql "select array_except([1,2,3], [2,3,4,null])"
     qt_sql "select array_intersect([1,2,3], [2,3,4,null])"
+
+    // arrat_slice function
+    qt_sql "select [1,2,3][1:1]"
+    qt_sql "select [1,2,3][1:3]"
+    qt_sql "select [1,2,3][1:5]"
+    qt_sql "select [1,2,3][2:]"
+    qt_sql "select [1,2,3][-2:]"
+    qt_sql "select [1,2,3][2:-1]"
+    qt_sql "select [1,2,3][0:]"
+    qt_sql "select [1,2,3][-5:]"
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to