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 380e3695f8 [test](window-function) add cte test in regression of 
window function #12635
380e3695f8 is described below

commit 380e3695f83132c111bb4394e90ab33519f26761
Author: lsy3993 <110876560+lsy3...@users.noreply.github.com>
AuthorDate: Fri Sep 16 10:27:50 2022 +0800

    [test](window-function) add cte test in regression of window function #12635
---
 .../window_functions/test_window_fn.out            | 39 ++++++++++++++++++++++
 .../window_functions/test_window_fn.groovy         | 16 +++++++++
 2 files changed, 55 insertions(+)

diff --git 
a/regression-test/data/query_p0/sql_functions/window_functions/test_window_fn.out
 
b/regression-test/data/query_p0/sql_functions/window_functions/test_window_fn.out
index b3a92b1ade..06b1d657cd 100644
--- 
a/regression-test/data/query_p0/sql_functions/window_functions/test_window_fn.out
+++ 
b/regression-test/data/query_p0/sql_functions/window_functions/test_window_fn.out
@@ -586,3 +586,42 @@ sales      4       4800    14600
 
 -- !sql --
 
+-- !sql --
+1      60
+2      60
+3      60
+4      60
+5      60
+7      60
+8      60
+9      60
+10     60
+11     60
+
+-- !sql --
+1      1
+2      3
+3      6
+4      10
+5      15
+7      22
+8      30
+9      39
+10     49
+11     60
+
+-- !sql --
+1      2
+1      3
+1      3
+1      4
+2      6
+3      9
+4      12
+5      16
+7      20
+8      24
+9      27
+10     30
+11     21
+
diff --git 
a/regression-test/suites/query_p0/sql_functions/window_functions/test_window_fn.groovy
 
b/regression-test/suites/query_p0/sql_functions/window_functions/test_window_fn.groovy
index fd29beac15..1db5041cc7 100644
--- 
a/regression-test/suites/query_p0/sql_functions/window_functions/test_window_fn.groovy
+++ 
b/regression-test/suites/query_p0/sql_functions/window_functions/test_window_fn.groovy
@@ -302,6 +302,22 @@ suite("test_window_fn") {
         WHERE total <> fourcount + twosum;
     """
 
+    // cte
+    qt_sql """
+        with cte as (select empno as x from ${tbName1}) 
+        SELECT x, (sum(x) over  (ORDER BY x range between UNBOUNDED preceding 
and UNBOUNDED following)) FROM cte;
+    """
+    qt_sql """
+        with cte as (select empno as x from ${tbName1}) 
+        SELECT x, (sum(x) over  (ORDER BY x range between UNBOUNDED preceding 
and CURRENT ROW)) FROM cte;
+    """
+    qt_sql """
+        WITH cte  AS (
+        select 1 as x union all select 1 as x union all select 1 as x union all
+        SELECT empno as x FROM ${tbName1})
+        SELECT x, (sum(x) over  (ORDER BY x rows between 1 preceding and 1 
following)) FROM cte;
+    """
+
     sql "DROP TABLE IF EXISTS ${tbName1};"
     sql "DROP TABLE IF EXISTS ${tbName2};"
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to