Skip to content

Commit

Permalink
fix some regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Dec 14, 2023
1 parent 486eeb6 commit a4e163a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -875,5 +875,26 @@ class Suite implements GroovyInterceptable {
}
return result.last().get(0);
}

void waiteCreateTableFinished(String tableName) {
Thread.sleep(2000);
String showCreateTable = "SHOW CREATE TABLE ${tableName}"
String createdTableName = "";
List<List<Object>> result
long startTime = System.currentTimeMillis()
long timeoutTimestamp = startTime + 1 * 60 * 1000 // 1 min
do {
result = sql(showCreateTable)
if (!result.isEmpty()) {
createdTableName = result.last().get(0)
}
logger.info("create table result of ${showCreateTable} is ${createdTableName}")
Thread.sleep(500);
} while (timeoutTimestamp > System.currentTimeMillis() && createdTableName.isEmpty())
if (createdTableName.isEmpty()) {
logger.info("create table is not success")
}
Assert.assertEquals(true, !createdTableName.isEmpty())
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ suite("aggregate_with_roll_up") {
)
"""

waiteCreateTableFinished("lineitem")
sql """ insert into lineitem values (1, 2, 3, 4, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-12-08', '2023-12-09', '2023-12-10', 'a', 'b', 'yyyyyyyyy'),
(2, 2, 3, 6, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-12-11', '2023-12-12', '2023-12-13', 'c', 'd', 'xxxxxxxxx');"""

waiteCreateTableFinished("orders")
sql """
insert into orders values (1, 1, 'ok', 99.5, '2023-12-08', 'a', 'b', 1, 'yy'),
(2, 2, 'ok', 109.2, '2023-12-09', 'c','d',2, 'mm');
"""

waiteCreateTableFinished("partsupp")
sql """
insert into partsupp values (2, 3, 9, 10.01, 'supply1'),
(2, 3, 10, 11.01, 'supply2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,16 @@ suite("aggregate_without_roll_up") {
)
"""

waiteCreateTableFinished("lineitem");
sql """ insert into lineitem values (1, 2, 3, 4, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-12-08', '2023-12-09', '2023-12-10', 'a', 'b', 'yyyyyyyyy'),
(2, 2, 3, 6, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-12-11', '2023-12-12', '2023-12-13', 'c', 'd', 'xxxxxxxxx');"""

waiteCreateTableFinished("orders");
sql """
insert into orders values (1, 1, 'ok', 99.5, '2023-12-08', 'a', 'b', 1, 'yy'),
(2, 2, 'ok', 109.2, '2023-12-09', 'c','d',2, 'mm');
"""

waiteCreateTableFinished("partsupp");
sql """
insert into partsupp values (2, 3, 9, 10.01, 'supply1'),
(2, 3, 10, 11.01, 'supply2');
Expand Down
3 changes: 3 additions & 0 deletions regression-test/suites/nereids_rules_p0/mv/inner_join.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ suite("inner_join") {
)
"""

waiteCreateTableFinished("lineitem")
sql """ insert into lineitem values (1, 2, 3, 4, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-12-08', '2023-12-09', '2023-12-10', 'a', 'b', 'yyyyyyyyy'),
(2, 2, 3, 6, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-12-11', '2023-12-12', '2023-12-13', 'c', 'd', 'xxxxxxxxx');"""

waiteCreateTableFinished("orders")
sql """
insert into orders values (1, 1, 'ok', 99.5, '2023-12-08', 'a', 'b', 1, 'yy'),
(2, 2, 'ok', 109.2, '2023-12-09', 'c','d',2, 'mm');
"""

waiteCreateTableFinished("partsupp")
sql """
insert into partsupp values (2, 3, 9, 10.01, 'supply1'),
(2, 3, 10, 11.01, 'supply2');
Expand Down

0 comments on commit a4e163a

Please sign in to comment.