Skip to content

Commit

Permalink
fix regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Aug 8, 2024
1 parent b643f59 commit d53d29c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,28 +133,6 @@ suite("agg_on_none_agg") {
sql """analyze table lineitem with sync;"""
sql """analyze table partsupp with sync;"""

def check_rewrite_but_not_chose = { mv_sql, query_sql, mv_name ->

sql """DROP MATERIALIZED VIEW IF EXISTS ${mv_name}"""
sql"""
CREATE MATERIALIZED VIEW ${mv_name}
BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES ('replication_num' = '1')
AS ${mv_sql}
"""

def job_name = getJobName(db, mv_name);
waitingMTMVTaskFinished(job_name)
explain {
sql("${query_sql}")
check {result ->
def splitResult = result.split("MaterializedViewRewriteFail")
splitResult.length == 2 ? splitResult[0].contains(mv_name) : false
}
}
}

// query used expression is in mv
def mv1_0 = """
select case when o_shippriority > 1 and o_orderkey IN (4, 5) then o_custkey else o_shippriority end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ suite("agg_optimize_when_uniform") {
(2, 3, 10, 11.01, 'supply2');
"""

sql """analyze table lineitem with sync;"""
sql """analyze table orders with sync;"""
sql """analyze table partsupp with sync;"""

// single table
// filter cover all roll up dimensions and contains agg function in mapping, combinator handler
def mv1_0 = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ suite("materialized_view_grouping_sets") {
(2, 3, 10, 11.01, 'supply2');
"""

sql """analyze table lineitem with sync;"""
sql """analyze table orders with sync;"""
sql """analyze table partsupp with sync;"""

// query has group sets, and mv doesn't
// single table grouping sets without grouping scalar function
def mv1_0 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ suite("inner_join_dphyp") {
(2, 3, 10, 11.01, 'supply2');
"""

sql """analyze table lineitem with sync;"""
sql """analyze table orders with sync;"""
sql """analyze table partsupp with sync;"""

// without filter
def mv1_0 = "select lineitem.L_LINENUMBER, orders.O_CUSTKEY " +
"from lineitem " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ suite("outer_join_dphyp") {
(2, 3, 10, 11.01, 'supply2');
"""

sql """analyze table lineitem with sync;"""
sql """analyze table orders with sync;"""
sql """analyze table partsupp with sync;"""

// without filter
def mv1_0 = "select lineitem.L_LINENUMBER, orders.O_CUSTKEY " +
"from lineitem " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ suite("inner_join") {
(2, 3, 10, 11.01, 'supply2');
"""

sql """analyze table lineitem with sync;"""
sql """analyze table orders with sync;"""
sql """analyze table partsupp with sync;"""

// without filter
def mv1_0 =
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ suite("outer_join") {
(2, 3, 10, 11.01, 'supply2');
"""

sql """analyze table lineitem with sync;"""
sql """analyze table orders with sync;"""
sql """analyze table partsupp with sync;"""

// without filter
def mv1_0 = "select lineitem.L_LINENUMBER, orders.O_CUSTKEY " +
"from lineitem " +
Expand Down

0 comments on commit d53d29c

Please sign in to comment.