From d9dd0e139b25ef91475630e69d56611e07055b5b Mon Sep 17 00:00:00 2001 From: seawinde Date: Thu, 16 Nov 2023 10:54:56 +0800 Subject: [PATCH] [test](nereids) remove some tests and modify some tests --- .../mv/single_table_without_aggregate.out | 6 --- .../mv/single_table_without_aggregate.groovy | 53 +++++-------------- 2 files changed, 12 insertions(+), 47 deletions(-) diff --git a/regression-test/data/nereids_rules_p0/mv/single_table_without_aggregate.out b/regression-test/data/nereids_rules_p0/mv/single_table_without_aggregate.out index 144997d7456b66..6c3db428036d1b 100644 --- a/regression-test/data/nereids_rules_p0/mv/single_table_without_aggregate.out +++ b/regression-test/data/nereids_rules_p0/mv/single_table_without_aggregate.out @@ -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 -- @@ -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 diff --git a/regression-test/suites/nereids_rules_p0/mv/single_table_without_aggregate.groovy b/regression-test/suites/nereids_rules_p0/mv/single_table_without_aggregate.groovy index 13214f53a72c21..580e051fe4a1cf 100644 --- a/regression-test/suites/nereids_rules_p0/mv/single_table_without_aggregate.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/single_table_without_aggregate.groovy @@ -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 " + @@ -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 " + @@ -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 " + @@ -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 " +