This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new d792a624095 [fix](regression) fix regression failure of window_funnel
caused by duplicated table name (#40216)
d792a624095 is described below
commit d792a624095d7e283b92e99fd8cb9af89d9c64c8
Author: TengJianPing <[email protected]>
AuthorDate: Sat Aug 31 20:58:20 2024 +0800
[fix](regression) fix regression failure of window_funnel caused by
duplicated table name (#40216)
BP #40217
---
.../data/nereids_p0/aggregate/window_funnel.out | 3 +
.../window_functions/window_funnel.out | 84 -----
.../data/query_p0/aggregate/window_funnel.out | 31 --
.../nereids_p0/aggregate/window_funnel.groovy | 67 +++-
.../window_functions/window_funnel.sql | 92 ------
.../suites/query_p0/aggregate/window_funnel.groovy | 360 ---------------------
6 files changed, 69 insertions(+), 568 deletions(-)
diff --git a/regression-test/data/nereids_p0/aggregate/window_funnel.out
b/regression-test/data/nereids_p0/aggregate/window_funnel.out
index f16f050c8e6..0bbe397fe3e 100644
--- a/regression-test/data/nereids_p0/aggregate/window_funnel.out
+++ b/regression-test/data/nereids_p0/aggregate/window_funnel.out
@@ -11,6 +11,9 @@
-- !window_funnel --
2
+-- !window_funnel_deduplication_compat --
+4
+
-- !window_funnel_deduplication --
2
diff --git
a/regression-test/data/nereids_p0/sql_functions/window_functions/window_funnel.out
b/regression-test/data/nereids_p0/sql_functions/window_functions/window_funnel.out
deleted file mode 100644
index 43948dc7951..00000000000
---
a/regression-test/data/nereids_p0/sql_functions/window_functions/window_funnel.out
+++ /dev/null
@@ -1,84 +0,0 @@
--- This file is automatically generated. You should know what you did if you
want to edit this
--- !window_funnel --
-0
-
--- !window_funnel_2 --
-0
-
--- !window_funnel_3 --
-4
-
--- !window_funnel_4 --
-1 2022-03-12T19:05:04 4
-1 2022-03-12T16:15:01 3
-1 2022-03-12T13:28:02 2
-1 2022-03-12T10:41 1
-
--- !window_funnel_5 --
-1
-
--- !window_funnel_6 --
-2
-
--- !window_funnel_7 --
-0
-
--- !window_funnel_8 --
-1
-
--- !window_funnel_9 --
-1
-
--- !window_funnel_10 --
-1
-
--- !window_funnel_11 --
-1
-
--- !window_funnel_12 --
-1
-
--- !window_funnel_13 --
-1
-
--- !window_funnel_14 --
-1
-
--- !window_funnel_15 --
-1
-
--- !window_funnel_16 --
-1
-
--- !window_funnel_17 --
-1
-
--- !window_funnel_18 --
-1
-
--- !window_funnel_19 --
-1
-
--- !window_funnel_20 --
-1
-
--- !window_funnel_21 --
-1
-
--- !window_funnel_22 --
-1
-
--- !window_funnel_23 --
-1
-
--- !window_funnel_24 --
-1
-
--- !window_funnel_25 --
-1
-
--- !window_funnel_26 --
-users 13
-browser 10
-buy 1
-
diff --git a/regression-test/data/query_p0/aggregate/window_funnel.out
b/regression-test/data/query_p0/aggregate/window_funnel.out
deleted file mode 100644
index fa239a9e719..00000000000
--- a/regression-test/data/query_p0/aggregate/window_funnel.out
+++ /dev/null
@@ -1,31 +0,0 @@
--- This file is automatically generated. You should know what you did if you
want to edit this
--- !window_funnel --
-1
-
--- !window_funnel --
-2
-
--- !window_funnel --
-1
-
--- !window_funnel --
-2
-
--- !window_funnel_deduplication_compat --
-4
-
--- !window_funnel_deduplication --
-2
-
--- !window_funnel_fixed --
-2
-
--- !window_funnel_fixed --
-1
-
--- !window_funnel_increase --
-4
-
--- !window_funnel_increase --
-2
-
diff --git a/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
b/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
index 7b551c28ac2..378311a575f 100644
--- a/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
+++ b/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
@@ -111,7 +111,7 @@ suite("window_funnel") {
strBuilder.append("curl --location-trusted -u " + context.config.jdbcUser
+ ":" + context.config.jdbcPassword)
strBuilder.append(" http://" + context.config.feHttpAddress +
"/rest/v1/config/fe?conf_item=be_exec_version")
- String command = strBuilder.toString()
+ def command = strBuilder.toString()
def process = command.toString().execute()
def code = process.waitFor()
def err = IOGroovyMethods.getText(new BufferedReader(new
InputStreamReader(process.getErrorStream())));
@@ -130,8 +130,73 @@ suite("window_funnel") {
}
}
if (beExecVersion < 3) {
+ sql """ DROP TABLE IF EXISTS ${tableName} """
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tableName} (
+ xwho varchar(50) NULL COMMENT 'xwho',
+ xwhen datetimev2(3) COMMENT 'xwhen',
+ xwhat int NULL COMMENT 'xwhat'
+ )
+ DUPLICATE KEY(xwho)
+ DISTRIBUTED BY HASH(xwho) BUCKETS 3
+ PROPERTIES (
+ "replication_num" = "1"
+ );
+ """
+ sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 10:41:00.111111', 1)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:02.111111', 2)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:03.111111', 2)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 14:15:01.111111', 3)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 15:05:04.111111', 4)"
+ qt_window_funnel_deduplication_compat """
+ select
+ window_funnel(
+ 20000,
+ 'deduplication',
+ t.xwhen,
+ t.xwhat = 1,
+ t.xwhat = 2,
+ t.xwhat = 3,
+ t.xwhat = 4
+ ) AS level
+ from ${tableName} t;
+ """
+ sql """ DROP TABLE IF EXISTS ${tableName} """
logger.warn("Be exec version(${beExecVersion}) is less than 3, skip
window_funnel mode test")
return
+ } else {
+ sql """ DROP TABLE IF EXISTS ${tableName} """
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tableName} (
+ xwho varchar(50) NULL COMMENT 'xwho',
+ xwhen datetimev2(3) COMMENT 'xwhen',
+ xwhat int NULL COMMENT 'xwhat'
+ )
+ DUPLICATE KEY(xwho)
+ DISTRIBUTED BY HASH(xwho) BUCKETS 3
+ PROPERTIES (
+ "replication_num" = "1"
+ );
+ """
+ sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 10:41:00.111111', 1)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:02.111111', 2)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:03.111111', 2)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 14:15:01.111111', 3)"
+ sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 15:05:04.111111', 4)"
+ qt_window_funnel_deduplication_compat """
+ select
+ window_funnel(
+ 20000,
+ 'default',
+ t.xwhen,
+ t.xwhat = 1,
+ t.xwhat = 2,
+ t.xwhat = 3,
+ t.xwhat = 4
+ ) AS level
+ from ${tableName} t;
+ """
+ sql """ DROP TABLE IF EXISTS ${tableName} """
}
sql """ DROP TABLE IF EXISTS ${tableName} """
diff --git
a/regression-test/suites/nereids_p0/sql_functions/window_functions/window_funnel.sql
b/regression-test/suites/nereids_p0/sql_functions/window_functions/window_funnel.sql
deleted file mode 100644
index 00fc65c1cc8..00000000000
---
a/regression-test/suites/nereids_p0/sql_functions/window_functions/window_funnel.sql
+++ /dev/null
@@ -1,92 +0,0 @@
-DROP TABLE IF EXISTS windowfunnel_test;
-
-CREATE TABLE IF NOT EXISTS windowfunnel_test (
- `xwho` varchar(50) NULL COMMENT 'xwho',
- `xwhen` datetime COMMENT 'xwhen',
- `xwhat` int NULL COMMENT 'xwhat'
- )
-DUPLICATE KEY(xwho)
-DISTRIBUTED BY HASH(xwho) BUCKETS 3
-PROPERTIES (
- "replication_num" = "1"
-);
-
-INSERT into windowfunnel_test (xwho, xwhen, xwhat) values ('1', '2022-03-12
10:41:00', 1),
- ('1', '2022-03-12
13:28:02', 2),
- ('1', '2022-03-12
16:15:01', 3),
- ('1', '2022-03-12
19:05:04', 4);
-
-select * from windowfunnel_test;
-
-select window_funnel(1, 'default', t.xwhen, t.xwhat = 1, t.xwhat = 2 ) AS
level from windowfunnel_test t;
-select window_funnel(3600 * 3, 'default', t.xwhen, t.xwhat = 1, t.xwhat = 2 )
AS level from windowfunnel_test t;
-
-
-CREATE TABLE IF NOT EXISTS user_analysis
-(
- user_id INT NOT NULL ,
- event_type varchar(20) ,
- event_time datetime NOT NULL
-)
-DUPLICATE KEY(`user_id`, `event_type`)
-DISTRIBUTED BY HASH(`event_type`) BUCKETS 2
-PROPERTIES (
- "replication_num" = "1"
-);
-
-
-insert into user_analysis values (1000001,'browse', '2022-07-17 00:00:00');
-insert into user_analysis values (1000002,'browse','2022-07-18 00:00:00');
-insert into user_analysis values (1000003,'shopping cart','2022-07-19
00:00:00');
-insert into user_analysis values (1000004,'browse','2022-07-20 00:00:00');
-insert into user_analysis values (1000005,'browse','2022-07-21 00:00:00');
-insert into user_analysis values (1000006,'favorite','2022-07-22 00:00:00');
-insert into user_analysis values (1000007,'browse','2022-07-23 00:00:00');
-insert into user_analysis values (1000008,'browse','2022-07-23 23:31:00');
-insert into user_analysis values (1000008,'favorite','2022-07-23 23:50:00');
-insert into user_analysis values (1000008,'shopping cart','2022-07-23
23:58:00');
-insert into user_analysis values (1000008,'buy','2022-07-24 00:00:00');
-insert into user_analysis values (1000009,'browse','2022-07-25 00:00:00');
-insert into user_analysis values (1000010,'favorite','2022-07-26 00:00:00');
-insert into user_analysis values (1000007,'browse','2022-07-27 00:00:00');
-insert into user_analysis values (1000012,'browse','2022-07-28 00:00:00');
-insert into user_analysis values (1000013,'browse','2022-07-29 00:00:00');
-insert into user_analysis values (1000014,'browse','2022-07-30 00:00:00');
-insert into user_analysis values (1000015,'browse','2022-07-31 00:00:00');
-
-WITH
- level_detail AS (
- SELECT
- level
- ,COUNT(1) AS count_user
- FROM (
- SELECT
- user_id
- ,window_funnel(
- 1800
- ,'default'
- ,event_time
- ,event_type = 'browse'
- ,event_type = 'favorite'
- ,event_type = 'shopping cart'
- ,event_type = 'buy'
- ) AS level
- FROM user_analysis
- WHERE event_time >= TIMESTAMP '2022-07-17 00:00:00'
- AND event_time < TIMESTAMP '2022-07-31 00:00:00'
- GROUP BY user_id
- ) AS basic_table
- GROUP BY level
- ORDER BY level ASC )
-SELECT CASE level WHEN 0 THEN 'users'
- WHEN 1 THEN 'browser'
- WHEN 2 THEN 'favorite'
- WHEN 3 THEN 'shopping cart'
- WHEN 4 THEN 'buy'
- END
- ,SUM(count_user) over ( ORDER BY level DESC )
-FROM level_detail
-GROUP BY level
- ,count_user
-ORDER BY level ASC;
-
diff --git a/regression-test/suites/query_p0/aggregate/window_funnel.groovy
b/regression-test/suites/query_p0/aggregate/window_funnel.groovy
deleted file mode 100644
index 63d21a9663b..00000000000
--- a/regression-test/suites/query_p0/aggregate/window_funnel.groovy
+++ /dev/null
@@ -1,360 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-// The cases is copied from https://github.com/trinodb/trino/tree/master
-//
/testing/trino-product-tests/src/main/resources/sql-tests/testcases/aggregate
-// and modified by Doris.
-
-import org.codehaus.groovy.runtime.IOGroovyMethods
-
-suite("window_funnel") {
- def tableName = "windowfunnel_test"
-
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetime COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
10:41:00', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
16:15:01', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
19:05:04', 4)"
-
- qt_window_funnel """ select
- window_funnel(
- 1,
- 'default',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2
- ) AS level
- from ${tableName} t;
- """
- qt_window_funnel """ select
- window_funnel(
- 20000,
- 'default',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2
- ) AS level
- from ${tableName} t;
- """
-
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
16:15:01.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
19:05:04.111111', 4)"
-
- qt_window_funnel """
- select
- window_funnel(
- 1,
- 'default',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2
- ) AS level
- from ${tableName} t;
- """
- qt_window_funnel """
- select
- window_funnel(
- 20000,
- 'default',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
-
- StringBuilder strBuilder = new StringBuilder()
- strBuilder.append("curl --location-trusted -u " + context.config.jdbcUser
+ ":" + context.config.jdbcPassword)
- strBuilder.append(" http://" + context.config.feHttpAddress +
"/rest/v1/config/fe?conf_item=be_exec_version")
-
- def command = strBuilder.toString()
- def process = command.toString().execute()
- def code = process.waitFor()
- def err = IOGroovyMethods.getText(new BufferedReader(new
InputStreamReader(process.getErrorStream())));
- def out = process.getText()
- logger.info("Request FE Config: code=" + code + ", out=" + out + ", err="
+ err)
- assertEquals(code, 0)
- def response = parseJson(out.trim())
- assertEquals(response.code, 0)
- assertEquals(response.msg, "success")
- def configJson = response.data.rows
- def beExecVersion = 0
- for (Object conf: configJson) {
- assert conf instanceof Map
- if (((Map<String, String>) conf).get("Name").toLowerCase() ==
"be_exec_version") {
- beExecVersion = ((Map<String, String>)
conf).get("Value").toInteger()
- }
- }
- if (beExecVersion < 3) {
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:03.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 14:15:01.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 15:05:04.111111', 4)"
- qt_window_funnel_deduplication_compat """
- select
- window_funnel(
- 20000,
- 'deduplication',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2,
- t.xwhat = 3,
- t.xwhat = 4
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
- logger.warn("Be exec version(${beExecVersion}) is less than 3, skip
window_funnel mode test")
- return
- } else {
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 13:28:03.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 14:15:01.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1',
'2022-03-12 15:05:04.111111', 4)"
- qt_window_funnel_deduplication_compat """
- select
- window_funnel(
- 20000,
- 'default',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2,
- t.xwhat = 3,
- t.xwhat = 4
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
- }
-
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:03.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
14:15:01.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
15:05:04.111111', 4)"
- qt_window_funnel_deduplication """
- select
- window_funnel(
- 20000,
- 'deduplication',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2,
- t.xwhat = 3,
- t.xwhat = 4
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
-
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
14:15:01.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
15:05:04.111111', 4)"
- qt_window_funnel_fixed """
- select
- window_funnel(
- 20000,
- 'fixed',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2,
- t.xwhat = 4,
- t.xwhat = 3
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
-
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
14:15:01.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
15:05:04.111111', 4)"
- qt_window_funnel_fixed """
- select
- window_funnel(
- 20000,
- 'fixed',
- t.xwhen,
- t.xwhat = 4,
- t.xwhat = 3,
- t.xwhat = 2,
- t.xwhat = 1
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
-
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:03.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
15:05:04.111111', 4)"
- qt_window_funnel_increase """
- select
- window_funnel(
- 20000,
- 'increase',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2,
- t.xwhat = 3,
- t.xwhat = 4
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
-
- sql """ DROP TABLE IF EXISTS ${tableName} """
- sql """
- CREATE TABLE IF NOT EXISTS ${tableName} (
- xwho varchar(50) NULL COMMENT 'xwho',
- xwhen datetimev2(3) COMMENT 'xwhen',
- xwhat int NULL COMMENT 'xwhat'
- )
- DUPLICATE KEY(xwho)
- DISTRIBUTED BY HASH(xwho) BUCKETS 3
- PROPERTIES (
- "replication_num" = "1"
- );
- """
- sql "INSERT into ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
10:41:00.111111', 1)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02.111111', 2)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
13:28:02.111111', 3)"
- sql "INSERT INTO ${tableName} (xwho, xwhen, xwhat) VALUES('1', '2022-03-12
15:05:04.111111', 4)"
- qt_window_funnel_increase """
- select
- window_funnel(
- 20000,
- 'increase',
- t.xwhen,
- t.xwhat = 1,
- t.xwhat = 2,
- t.xwhat = 3,
- t.xwhat = 4
- ) AS level
- from ${tableName} t;
- """
- sql """ DROP TABLE IF EXISTS ${tableName} """
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]