Skip to content

Commit

Permalink
[test](nereids) remove some tests and modify some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Nov 16, 2023
1 parent 03c4fe4 commit d9dd0e1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
1 34.22 2023-01-01
2 66.22 2023-01-02

-- !query2_3 --
1 34.22 2023-01-01
2 66.22 2023-01-02

-- !query1_0 --

-- !query3_0 --
Expand All @@ -51,8 +47,6 @@
2 66.22 2023-01-02

-- !query4_1 --

-- !query4_2 --
1 34.22 2023-01-01
2 66.22 2023-01-02

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,12 @@ suite("single_table_without_aggregate") {
"from orders "
def query2_2 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
"from orders " +
"order by O_CUSTKEY"
// should support but not, need to fix order key not appear select
"order by O_ORDERKEY limit 10"
// should support but not, need to fix limit
// check_rewrite(mv2_2, query2_2, "mv2_2")
order_qt_query2_2 "${query2_2}"
sql """DROP MATERIALIZED VIEW IF EXISTS mv2_2 ON orders"""

def mv2_3 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
"from orders "
def query2_3 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
"from orders " +
"order by O_ORDERKEY limit 10"
// should support but not, need to fix limit
// check_rewrite(mv2_3, query2_3, "mv2_3")
order_qt_query2_3 "${query2_3}"
sql """DROP MATERIALIZED VIEW IF EXISTS mv2_3 ON orders"""


// select + from + filter
def mv3_0 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
Expand Down Expand Up @@ -161,35 +151,20 @@ suite("single_table_without_aggregate") {


def mv4_1 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
"from orders " +
"where abs(O_TOTALPRICE) > 10 and O_ORDERKEY > 1"
def query4_1 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
"from orders " +
"where abs(O_TOTALPRICE) > 20 and O_ORDERKEY > 5 " +
"order by O_CUSTKEY "
// should support but not, need to fix predicate compensation
// check_rewrite(mv4_1, query4_1, "mv4_1")
order_qt_query4_1 "${query4_1}"
sql """DROP MATERIALIZED VIEW IF EXISTS mv4_1 ON orders"""


def mv4_2 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
"from orders "
def query4_2 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
def query4_1 = "select O_ORDERKEY, abs(O_TOTALPRICE), O_ORDERDATE as d " +
"from orders " +
"where abs(O_TOTALPRICE) > 10 " +
"order by O_ORDERKEY limit 10"
// should support but not, need to fix limit
// check_rewrite(mv4_2, query4_2, "mv4_2")
order_qt_query4_2 "${query4_2}"
sql """DROP MATERIALIZED VIEW IF EXISTS mv4_2 ON orders"""
// check_rewrite(mv4_1, query4_1, "mv4_1")
order_qt_query4_1 "${query4_1}"
sql """DROP MATERIALIZED VIEW IF EXISTS mv4_1 ON orders"""


// select + from + sub query
def mv5_0 = "select sub_query.O_ORDERKEY, sub_query.abs_price, sub_query.d " +
"from " +
"(select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
"from orders) sub_query"
def mv5_0 = "select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
"from orders sub_query"
def query5_0 = "select sub_query.O_ORDERKEY, sub_query.abs_price, sub_query.d " +
"from " +
"(select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
Expand All @@ -200,10 +175,8 @@ suite("single_table_without_aggregate") {
sql """DROP MATERIALIZED VIEW IF EXISTS mv5_0 ON orders"""

// select + from + filter + sub query
def mv5_1 = "select sub_query.O_ORDERKEY, sub_query.abs_price, sub_query.d " +
"from " +
"(select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
"from orders) sub_query "
def mv5_1 = "select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
"from orders sub_query "
def query5_1 = "select sub_query.O_ORDERKEY, sub_query.abs_price, sub_query.d " +
"from " +
"(select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
Expand All @@ -216,10 +189,8 @@ suite("single_table_without_aggregate") {


// select + from + filter + order by + limit + sub query
def mv5_2 = "select sub_query.O_ORDERKEY, sub_query.abs_price, sub_query.d " +
"from " +
"(select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
"from orders) sub_query "
def mv5_2 = "select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
"from orders "
def query5_2 = "select sub_query.O_ORDERKEY, sub_query.abs_price, sub_query.d " +
"from " +
"(select 1, O_ORDERKEY, abs(O_TOTALPRICE) as abs_price , O_ORDERDATE as d " +
Expand Down

0 comments on commit d9dd0e1

Please sign in to comment.