This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new bc4089af646 branch-3.0: [fix](case)fix range_datetime_part_up_rewrite case failed #47302 (#48132) bc4089af646 is described below commit bc4089af6465352321ed786d60abf8937a6869c7 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> AuthorDate: Thu Feb 20 17:10:56 2025 +0800 branch-3.0: [fix](case)fix range_datetime_part_up_rewrite case failed #47302 (#48132) Cherry-picked from #47302 Co-authored-by: zhangdong <zhangd...@selectdb.com> --- .../range_datetime_part_up_rewrite.groovy | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/regression-test/suites/nereids_rules_p0/mv/create_part_and_up/range_datetime_part_up_rewrite.groovy b/regression-test/suites/nereids_rules_p0/mv/create_part_and_up/range_datetime_part_up_rewrite.groovy index 140a91edd7c..6956123f856 100644 --- a/regression-test/suites/nereids_rules_p0/mv/create_part_and_up/range_datetime_part_up_rewrite.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/create_part_and_up/range_datetime_part_up_rewrite.groovy @@ -25,13 +25,14 @@ suite("mtmv_range_datetime_part_up_rewrite") { sql "SET enable_materialized_view_nest_rewrite=true" sql "SET enable_materialized_view_union_rewrite=true" sql "SET enable_nereids_timeout = false" - String mv_prefix = "range_datetime_up_union" - + String mv_prefix = "mtmv_range_datetime_part_up_rewrite" + String lineitemName = "${mv_prefix}_lineitem" + String ordersName = "${mv_prefix}_orders" sql """ - drop table if exists lineitem_range_datetime_union + drop table if exists ${lineitemName} """ - sql """CREATE TABLE `lineitem_range_datetime_union` ( + sql """CREATE TABLE `${lineitemName}` ( `l_orderkey` BIGINT NULL, `l_linenumber` INT NULL, `l_partkey` INT NULL, @@ -61,10 +62,10 @@ suite("mtmv_range_datetime_part_up_rewrite") { );""" sql """ - drop table if exists orders_range_datetime_union + drop table if exists ${ordersName} """ - sql """CREATE TABLE `orders_range_datetime_union` ( + sql """CREATE TABLE `${ordersName}` ( `o_orderkey` BIGINT NULL, `o_custkey` INT NULL, `o_orderstatus` VARCHAR(1) NULL, @@ -89,7 +90,7 @@ suite("mtmv_range_datetime_part_up_rewrite") { );""" sql """ - insert into lineitem_range_datetime_union values + insert into ${lineitemName} values (null, 1, 2, 3, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy', '2023-10-29 00:00:00'), (1, null, 3, 1, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-18', '2023-10-18', 'a', 'b', 'yyyyyyyyy', '2023-10-29 00:00:00'), (3, 3, null, 2, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-10-19', '2023-10-19', 'c', 'd', 'xxxxxxxxx', '2023-10-29 02:00:00'), @@ -98,10 +99,10 @@ suite("mtmv_range_datetime_part_up_rewrite") { (3, 1, 1, 2, 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-10-19', null, 'c', 'd', 'xxxxxxxxx', '2023-10-29 02:00:00'), (1, 3, 2, 2, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy', '2023-10-29 00:00:00'); """ - sql """alter table lineitem_range_datetime_union modify column l_comment set stats ('row_count'='7');""" + sql """alter table ${lineitemName} modify column l_comment set stats ('row_count'='7');""" sql """ - insert into orders_range_datetime_union values + insert into ${ordersName} values (null, 1, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-29 00:00:00'), (1, null, 'o', 109.2, 'c','d',2, 'mm', '2023-10-29 00:00:00'), (3, 3, null, 99.5, 'a', 'b', 1, 'yy', '2023-10-29 01:00:00'), @@ -113,18 +114,18 @@ suite("mtmv_range_datetime_part_up_rewrite") { (3, 2, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-29 00:00:00'), (4, 5, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-29 02:00:00'); """ - sql """alter table orders_range_datetime_union modify column o_comment set stats ('row_count'='10');""" + sql """alter table ${ordersName} modify column o_comment set stats ('row_count'='10');""" sql """DROP MATERIALIZED VIEW if exists ${mv_prefix}_mv1;""" sql """CREATE MATERIALIZED VIEW ${mv_prefix}_mv1 BUILD IMMEDIATE REFRESH AUTO ON MANUAL partition by(date_trunc(`col1`, 'month')) DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS - select date_trunc(`l_shipdate`, 'day') as col1, l_shipdate, l_orderkey from lineitem_range_datetime_union as t1 left join orders_range_datetime_union as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey;""" + select date_trunc(`l_shipdate`, 'day') as col1, l_shipdate, l_orderkey from ${lineitemName} as t1 left join ${ordersName} as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey;""" sql """DROP MATERIALIZED VIEW if exists ${mv_prefix}_mv2;""" sql """CREATE MATERIALIZED VIEW ${mv_prefix}_mv2 BUILD IMMEDIATE REFRESH AUTO ON MANUAL partition by(date_trunc(`col1`, 'month')) DISTRIBUTED BY RANDOM BUCKETS 2 PROPERTIES ('replication_num' = '1') AS - select date_trunc(`l_shipdate`, 'hour') as col1, l_shipdate, l_orderkey from lineitem_range_datetime_union as t1 left join orders_range_datetime_union as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey;""" + select date_trunc(`l_shipdate`, 'hour') as col1, l_shipdate, l_orderkey from ${lineitemName} as t1 left join ${ordersName} as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey;""" - def sql1 = """select date_trunc(`l_shipdate`, 'day') as col1, l_shipdate, l_orderkey from lineitem_range_datetime_union as t1 left join orders_range_datetime_union as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey""" - def sql2 = """select date_trunc(`l_shipdate`, 'hour') as col1, l_shipdate, l_orderkey from lineitem_range_datetime_union as t1 left join orders_range_datetime_union as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey""" + def sql1 = """select date_trunc(`l_shipdate`, 'day') as col1, l_shipdate, l_orderkey from ${lineitemName} as t1 left join ${ordersName} as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey""" + def sql2 = """select date_trunc(`l_shipdate`, 'hour') as col1, l_shipdate, l_orderkey from ${lineitemName} as t1 left join ${ordersName} as t2 on t1.l_orderkey = t2.o_orderkey group by col1, l_shipdate, l_orderkey""" def localWaitingMTMVTaskFinished = { def jobName -> Thread.sleep(2000); @@ -173,10 +174,10 @@ suite("mtmv_range_datetime_part_up_rewrite") { } - sql """alter table lineitem_range_datetime_union add partition p4 values [("2023-11-29 03:00:00"), ("2023-11-29 04:00:00"));""" - sql """insert into lineitem_range_datetime_union values + sql """alter table ${lineitemName} add partition p4 values [("2023-11-29 03:00:00"), ("2023-11-29 04:00:00"));""" + sql """insert into ${lineitemName} values (1, null, 3, 1, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-18', '2023-10-18', 'a', 'b', 'yyyyyyyyy', '2023-11-29 03:00:00')""" - sql """alter table lineitem_range_datetime_union modify column l_comment set stats ('row_count'='8');""" + sql """alter table ${lineitemName} modify column l_comment set stats ('row_count'='8');""" for (int i = 0; i < mv_name_list.size(); i++) { // both mv should rewrite success mv_rewrite_any_success(query_stmt_list[i], mv_name_list) @@ -190,9 +191,9 @@ suite("mtmv_range_datetime_part_up_rewrite") { compare_res(query_stmt_list[i] + " order by 1,2,3") } - sql """insert into lineitem_range_datetime_union values + sql """insert into ${lineitemName} values (3, null, 3, 1, 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-18', '2023-10-18', 'a', 'b', 'yyyyyyyyy', '2023-11-29 03:00:00');""" - sql """alter table lineitem_range_datetime_union modify column l_comment set stats ('row_count'='9');""" + sql """alter table ${lineitemName} modify column l_comment set stats ('row_count'='9');""" for (int i = 0; i < mv_name_list.size(); i++) { // both mv should rewrite success mv_rewrite_any_success(query_stmt_list[i], mv_name_list) @@ -206,7 +207,7 @@ suite("mtmv_range_datetime_part_up_rewrite") { compare_res(query_stmt_list[i] + " order by 1,2,3") } - sql """ALTER TABLE lineitem_range_datetime_union DROP PARTITION IF EXISTS p4 FORCE""" + sql """ALTER TABLE ${lineitemName} DROP PARTITION IF EXISTS p4 FORCE""" for (int i = 0; i < mv_name_list.size(); i++) { // both mv should rewrite success mv_rewrite_any_success(query_stmt_list[i], mv_name_list) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org