Skip to content

Commit

Permalink
fix regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Oct 22, 2024
1 parent 9dafbe0 commit a184fed
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,8 @@ class Suite implements GroovyInterceptable {
logger.info("status is not success")
}
Assert.assertEquals("SUCCESS", status)
logger.info("waitingMTMVTaskFinished analyze mv name is " + result.last().get(5))
sql "analyze table ${result.last().get(6)}.${result.last().get(5)} with sync;"
}

void waitingMTMVTaskFinishedNotNeedSuccess(String jobName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ suite ("k123p_nereids") {

qt_select_mv "select k2,k1=1 from d_table where k1=1 order by k2;"

mv_rewrite_success("select k2,k1=2 from d_table where k1=1 order by k2;", "kwh1")
mv_rewrite_fail("select k2,k1=2 from d_table where k1=1 order by k2;", "kwh1")

qt_select_mv "select k2,k1=2 from d_table where k1=1 order by k2;"

Expand Down
4 changes: 2 additions & 2 deletions regression-test/suites/nereids_p0/hint/test_use_mv.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ suite("test_use_mv") {
);
"""
sql """ alter table t1 add rollup r1(k2, k1); """
waitForRollUpJob("t1", 5000, 1)
waitForRollUpJob("t1", "r1", 15000)
sql """ alter table t1 add rollup r2(k2); """
waitForRollUpJob("t1", 5000, 1)
waitForRollUpJob("t1", "r2", 15000)
createMV("create materialized view k1_k2_sumk3 as select k1, k2, sum(v1) from t1 group by k1, k2;")
explain {
sql """select /*+ no_use_mv */ k1 from t1;"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ suite("materialized_view_switch") {
where o_orderdate = '2023-12-10' order by 1, 2, 3, 4, 5;
"""

check_mv_rewrite_success(db, mv_name, query, "mv_name")
async_mv_rewrite_success(db, mv_name, query, "mv_name")
sql "SET enable_materialized_view_rewrite=false"
check_mv_rewrite_fail(db, mv_name, query, "mv_name")
async_mv_rewrite_fail(db, mv_name, query, "mv_name")
sql "SET enable_materialized_view_rewrite=true"
check_mv_rewrite_success(db, mv_name, query, "mv_name")
async_mv_rewrite_success(db, mv_name, query, "mv_name")
sql """ DROP MATERIALIZED VIEW IF EXISTS mv_name"""

// test when materialized_view_relation_mapping_max_count is 8
Expand All @@ -153,7 +153,7 @@ suite("materialized_view_switch") {
inner join lineitem t2 on t1.L_ORDERKEY = t2.L_ORDERKEY;
"""
order_qt_query1_0_before "${query1_0}"
check_mv_rewrite_success(db, mv1_0, query1_0, "mv1_0")
async_mv_rewrite_success(db, mv1_0, query1_0, "mv1_0")
order_qt_query1_0_after "${query1_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv1_0"""

Expand All @@ -172,7 +172,7 @@ suite("materialized_view_switch") {
inner join lineitem t2 on t1.L_ORDERKEY = t2.L_ORDERKEY;
"""
order_qt_query1_1_before "${query1_1}"
check_mv_rewrite_fail(db, mv1_1, query1_1, "mv1_1")
async_mv_rewrite_fail(db, mv1_1, query1_1, "mv1_1")
order_qt_query1_1_after "${query1_1}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv1_1"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ suite("materialized_view_grouping_sets") {
GROUPING SETS ((o_orderstatus, o_orderdate), (o_orderpriority), (o_orderstatus), ());
"""
order_qt_query1_0_before "${query1_0}"
check_mv_rewrite_success(db, mv1_0, query1_0, "mv1_0")
async_mv_rewrite_success(db, mv1_0, query1_0, "mv1_0")
order_qt_query1_0_after "${query1_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv1_0"""

Expand Down Expand Up @@ -187,7 +187,7 @@ suite("materialized_view_grouping_sets") {
GROUPING SETS ((o_orderstatus, o_orderdate), (o_orderpriority), (o_orderstatus), ());
"""
order_qt_query2_0_before "${query2_0}"
check_mv_rewrite_success(db, mv2_0, query2_0, "mv2_0")
async_mv_rewrite_success(db, mv2_0, query2_0, "mv2_0")
order_qt_query2_0_after "${query2_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv2_0"""

Expand Down Expand Up @@ -223,7 +223,7 @@ suite("materialized_view_grouping_sets") {
GROUPING SETS ((l_shipdate, o_orderdate, l_partkey), (l_partkey, l_suppkey), (l_suppkey), ());
"""
order_qt_query3_0_before "${query3_0}"
check_mv_rewrite_success(db, mv3_0, query3_0, "mv3_0")
async_mv_rewrite_success(db, mv3_0, query3_0, "mv3_0")
order_qt_query3_0_after "${query3_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv3_0"""

Expand Down Expand Up @@ -263,7 +263,7 @@ suite("materialized_view_grouping_sets") {
GROUPING SETS ((l_shipdate, o_orderdate, l_partkey), (l_partkey, l_suppkey), (l_suppkey), ());
"""
order_qt_query4_0_before "${query4_0}"
check_mv_rewrite_success(db, mv4_0, query4_0, "mv4_0")
async_mv_rewrite_success(db, mv4_0, query4_0, "mv4_0")
order_qt_query4_0_after "${query4_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv4_0"""

Expand Down Expand Up @@ -294,7 +294,7 @@ suite("materialized_view_grouping_sets") {
CUBE (o_orderstatus, o_orderpriority);
"""
order_qt_query5_0_before "${query5_0}"
check_mv_rewrite_success(db, mv5_0, query5_0, "mv5_0")
async_mv_rewrite_success(db, mv5_0, query5_0, "mv5_0")
order_qt_query5_0_after "${query5_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv5_0"""

Expand Down Expand Up @@ -327,7 +327,7 @@ suite("materialized_view_grouping_sets") {
CUBE (o_orderstatus, o_orderpriority);
"""
order_qt_query6_0_before "${query6_0}"
check_mv_rewrite_success(db, mv6_0, query6_0, "mv6_0")
async_mv_rewrite_success(db, mv6_0, query6_0, "mv6_0")
order_qt_query6_0_after "${query6_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv6_0"""

Expand Down Expand Up @@ -362,7 +362,7 @@ suite("materialized_view_grouping_sets") {
CUBE (t1.l_partkey, t1.l_suppkey, o_orderdate);
"""
order_qt_query7_0_before "${query7_0}"
check_mv_rewrite_success(db, mv7_0, query7_0, "mv7_0")
async_mv_rewrite_success(db, mv7_0, query7_0, "mv7_0")
order_qt_query7_0_after "${query7_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv7_0"""

Expand Down Expand Up @@ -401,7 +401,7 @@ suite("materialized_view_grouping_sets") {
CUBE (t1.l_partkey, t1.l_suppkey, o_orderdate);
"""
order_qt_query8_0_before "${query8_0}"
check_mv_rewrite_success(db, mv8_0, query8_0, "mv8_0")
async_mv_rewrite_success(db, mv8_0, query8_0, "mv8_0")
order_qt_query8_0_after "${query8_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv8_0"""

Expand Down Expand Up @@ -433,7 +433,7 @@ suite("materialized_view_grouping_sets") {
ROLLUP (o_orderstatus, o_orderpriority);
"""
order_qt_query9_0_before "${query9_0}"
check_mv_rewrite_success(db, mv9_0, query9_0, "mv9_0")
async_mv_rewrite_success(db, mv9_0, query9_0, "mv9_0")
order_qt_query9_0_after "${query9_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv9_0"""

Expand Down Expand Up @@ -466,7 +466,7 @@ suite("materialized_view_grouping_sets") {
ROLLUP (o_orderstatus, o_orderpriority);
"""
order_qt_query10_0_before "${query10_0}"
check_mv_rewrite_success(db, mv10_0, query10_0, "mv10_0")
async_mv_rewrite_success(db, mv10_0, query10_0, "mv10_0")
order_qt_query10_0_after "${query10_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv10_0"""

Expand Down Expand Up @@ -501,7 +501,7 @@ suite("materialized_view_grouping_sets") {
ROLLUP (t1.l_partkey, t1.l_suppkey, o_orderdate);
"""
order_qt_query11_0_before "${query11_0}"
check_mv_rewrite_success(db, mv11_0, query11_0, "mv11_0")
async_mv_rewrite_success(db, mv11_0, query11_0, "mv11_0")
order_qt_query11_0_after "${query11_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv11_0"""

Expand Down Expand Up @@ -540,7 +540,7 @@ suite("materialized_view_grouping_sets") {
ROLLUP (t1.l_partkey, t1.l_suppkey, o_orderdate);
"""
order_qt_query12_0_before "${query12_0}"
check_mv_rewrite_success(db, mv12_0, query12_0, "mv12_0")
async_mv_rewrite_success(db, mv12_0, query12_0, "mv12_0")
order_qt_query12_0_after "${query12_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv12_0"""

Expand Down Expand Up @@ -572,7 +572,7 @@ suite("materialized_view_grouping_sets") {
GROUPING SETS ((o_orderstatus, o_orderdate), (o_orderpriority), (o_orderstatus), ());
"""
order_qt_query13_0_before "${query13_0}"
check_mv_rewrite_fail(db, mv13_0, query13_0, "mv13_0")
async_mv_rewrite_fail(db, mv13_0, query13_0, "mv13_0")
order_qt_query13_0_after "${query13_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv13_0"""

Expand Down Expand Up @@ -604,7 +604,7 @@ suite("materialized_view_grouping_sets") {
o_orderstatus, o_orderdate, o_orderpriority;
"""
order_qt_query14_0_before "${query14_0}"
check_mv_rewrite_fail(db, mv14_0, query14_0, "mv14_0")
async_mv_rewrite_fail(db, mv14_0, query14_0, "mv14_0")
order_qt_query14_0_after "${query14_0}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv14_0"""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ suite("nested_materialized_view") {
create_async_mv(db, "mv1_0_inner_mv", mv1_0_inner_mv)
async_mv_rewrite_fail(db, mv1_0, query1_0, "mv1_0")

mv_rewrite_all_success_without_check_chosen(query1_0, "mv1_0_inner_mv")
mv_rewrite_success_without_check_chosen(query1_0, "mv1_0_inner_mv")
order_qt_query1_1_after "${query1_0}"


Expand Down
26 changes: 13 additions & 13 deletions regression-test/suites/nereids_rules_p0/mv/ssb/mv_ssb_test.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ suite("mv_ssb_test") {
AND lo_quantity < 25;
"""
order_qt_query1_1_before "${query1_1}"
check_mv_rewrite_success(db, mv1_1, query1_1, "mv1_1")
async_mv_rewrite_success(db, mv1_1, query1_1, "mv1_1")
order_qt_query1_1_after "${query1_1}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv1_1"""

Expand All @@ -132,7 +132,7 @@ suite("mv_ssb_test") {
AND lo_quantity BETWEEN 26 AND 35;
"""
order_qt_query1_2_before "${query1_2}"
check_mv_rewrite_success(db, mv1_2, query1_2, "mv1_2")
async_mv_rewrite_success(db, mv1_2, query1_2, "mv1_2")
order_qt_query1_2_after "${query1_2}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv1_2"""

Expand All @@ -157,7 +157,7 @@ suite("mv_ssb_test") {
AND lo_quantity BETWEEN 26 AND 35;
"""
order_qt_query1_3before "${query1_3}"
check_mv_rewrite_success(db, mv1_3, query1_3, "mv1_3")
async_mv_rewrite_success(db, mv1_3, query1_3, "mv1_3")
order_qt_query1_3_after "${query1_3}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv1_3"""

Expand Down Expand Up @@ -185,7 +185,7 @@ suite("mv_ssb_test") {
ORDER BY d_year, p_brand;
"""
order_qt_query2_1before "${query2_1}"
check_mv_rewrite_success(db, mv2_1, query2_1, "mv2_1")
async_mv_rewrite_success(db, mv2_1, query2_1, "mv2_1")
order_qt_query2_1_after "${query2_1}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv2_1"""

Expand Down Expand Up @@ -215,7 +215,7 @@ suite("mv_ssb_test") {
ORDER BY d_year, p_brand;
"""
order_qt_query2_2before "${query2_2}"
check_mv_rewrite_success(db, mv2_2, query2_2, "mv2_2")
async_mv_rewrite_success(db, mv2_2, query2_2, "mv2_2")
order_qt_query2_2_after "${query2_2}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv2_2"""

Expand All @@ -242,7 +242,7 @@ suite("mv_ssb_test") {
ORDER BY d_year, p_brand;
"""
order_qt_query2_3before "${query2_3}"
check_mv_rewrite_success(db, mv2_3, query2_3, "mv2_3")
async_mv_rewrite_success(db, mv2_3, query2_3, "mv2_3")
order_qt_query2_3_after "${query2_3}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv2_3"""

Expand Down Expand Up @@ -273,7 +273,7 @@ suite("mv_ssb_test") {
ORDER BY d_year ASC, REVENUE DESC;
"""
order_qt_query3_1before "${query3_1}"
check_mv_rewrite_success(db, mv3_1, query3_1, "mv3_1")
async_mv_rewrite_success(db, mv3_1, query3_1, "mv3_1")
order_qt_query3_1_after "${query3_1}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv3_1"""

Expand Down Expand Up @@ -305,7 +305,7 @@ suite("mv_ssb_test") {
ORDER BY d_year ASC, REVENUE DESC;
"""
order_qt_query3_2before "${query3_2}"
check_mv_rewrite_success(db, mv3_2, query3_2, "mv3_2")
async_mv_rewrite_success(db, mv3_2, query3_2, "mv3_2")
order_qt_query3_2_after "${query3_2}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv3_2"""

Expand Down Expand Up @@ -341,7 +341,7 @@ suite("mv_ssb_test") {
ORDER BY d_year ASC, REVENUE DESC;
"""
order_qt_query3_3before "${query3_3}"
check_mv_rewrite_success(db, mv3_3, query3_3, "mv3_3")
async_mv_rewrite_success(db, mv3_3, query3_3, "mv3_3")
order_qt_query3_3_after "${query3_3}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv3_3"""

Expand Down Expand Up @@ -377,7 +377,7 @@ suite("mv_ssb_test") {
ORDER BY d_year ASC, REVENUE DESC;
"""
order_qt_query3_4before "${query3_4}"
check_mv_rewrite_success(db, mv3_4, query3_4, "mv3_4")
async_mv_rewrite_success(db, mv3_4, query3_4, "mv3_4")
order_qt_query3_4_after "${query3_4}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv3_4"""

Expand Down Expand Up @@ -413,7 +413,7 @@ suite("mv_ssb_test") {
ORDER BY d_year, c_nation;
"""
order_qt_query4_1before "${query4_1}"
check_mv_rewrite_success(db, mv4_1, query4_1, "mv4_1")
async_mv_rewrite_success(db, mv4_1, query4_1, "mv4_1")
order_qt_query4_1_after "${query4_1}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv4_1"""

Expand Down Expand Up @@ -450,7 +450,7 @@ suite("mv_ssb_test") {
ORDER BY d_year, s_nation, p_category;
"""
order_qt_query4_2before "${query4_2}"
check_mv_rewrite_success(db, mv4_2, query4_2, "mv4_2")
async_mv_rewrite_success(db, mv4_2, query4_2, "mv4_2")
order_qt_query4_2_after "${query4_2}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv4_2"""

Expand Down Expand Up @@ -484,7 +484,7 @@ suite("mv_ssb_test") {
ORDER BY d_year, s_city, p_brand;
"""
order_qt_query4_3before "${query4_3}"
check_mv_rewrite_success(db, mv4_3, query4_3, "mv4_3")
async_mv_rewrite_success(db, mv4_3, query4_3, "mv4_3")
order_qt_query4_3_after "${query4_3}"
sql """ DROP MATERIALIZED VIEW IF EXISTS mv4_3"""
}
Loading

0 comments on commit a184fed

Please sign in to comment.