Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](regression) fix regression failure of window_funnel caused by duplicated table name #40216

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading