Skip to content

Commit

Permalink
[fix](regression) fix regression failure of window_funnel caused by d…
Browse files Browse the repository at this point in the history
…uplicated table name (#40216)

BP #40217
  • Loading branch information
jacktengg authored Aug 31, 2024
1 parent 2a12251 commit d792a62
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 568 deletions.
3 changes: 3 additions & 0 deletions regression-test/data/nereids_p0/aggregate/window_funnel.out
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
-- !window_funnel --
2

-- !window_funnel_deduplication_compat --
4

-- !window_funnel_deduplication --
2

Expand Down

This file was deleted.

31 changes: 0 additions & 31 deletions regression-test/data/query_p0/aggregate/window_funnel.out

This file was deleted.

67 changes: 66 additions & 1 deletion regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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())));
Expand All @@ -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} """
Expand Down

This file was deleted.

Loading

0 comments on commit d792a62

Please sign in to comment.