From 4ccd6c6e59c626743655b5e9ef9400498c3f1099 Mon Sep 17 00:00:00 2001 From: seawinde Date: Thu, 14 Nov 2024 07:14:41 +0800 Subject: [PATCH] fix regression case --- .../ssb/multiple_no_where/multiple_no_where.groovy | 1 - .../suites/mv_p0/test_28741/test_28741.groovy | 2 +- .../test_dup_group_by_mv_abs.groovy | 2 +- .../mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy | 2 +- .../suites/mv_p0/test_mv_dp/test_mv_dp.groovy | 2 +- .../testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy | 3 +-- .../mv/agg_with_roll_up/aggregate_with_roll_up.groovy | 1 + .../nereids_rules_p0/mv/dimension/dimension_2_6.groovy | 3 --- .../outer/other_join_conjuncts_outer.groovy | 10 +++++----- .../single_table_without_aggregate.groovy | 3 +-- .../suites/nereids_syntax_p0/mv/ut/onStar.groovy | 2 -- 11 files changed, 12 insertions(+), 19 deletions(-) diff --git a/regression-test/suites/mv_p0/ssb/multiple_no_where/multiple_no_where.groovy b/regression-test/suites/mv_p0/ssb/multiple_no_where/multiple_no_where.groovy index 2bfdadfe26d84f..a02cd4861554d6 100644 --- a/regression-test/suites/mv_p0/ssb/multiple_no_where/multiple_no_where.groovy +++ b/regression-test/suites/mv_p0/ssb/multiple_no_where/multiple_no_where.groovy @@ -108,7 +108,6 @@ suite ("multiple_no_where") { sql """analyze table lineorder_flat with sync;""" sql """set enable_stats=false;""" - sql """alter table lineorder_flat modify column LO_ORDERDATE set stats ('row_count'='8');""" mv_rewrite_success("""SELECT SUM(LO_EXTENDEDPRICE * LO_DISCOUNT) AS revenue FROM lineorder_flat diff --git a/regression-test/suites/mv_p0/test_28741/test_28741.groovy b/regression-test/suites/mv_p0/test_28741/test_28741.groovy index ce5c32dbc7f92b..88fb3c057da092 100644 --- a/regression-test/suites/mv_p0/test_28741/test_28741.groovy +++ b/regression-test/suites/mv_p0/test_28741/test_28741.groovy @@ -68,9 +68,9 @@ suite ("test_28741") { sql """analyze table test with sync;""" sql """set enable_stats=false;""" - sql """alter table test modify column a set stats ('row_count'='2');""" mv_rewrite_fail("select b1 from test where t >= '2023-12-20 17:21:00'", "mv_test") sql """set enable_stats=true;""" + sql """alter table test modify column a set stats ('row_count'='2');""" mv_rewrite_fail("select b1 from test where t >= '2023-12-20 17:21:00'", "mv_test") } diff --git a/regression-test/suites/mv_p0/test_dup_group_by_mv_abs/test_dup_group_by_mv_abs.groovy b/regression-test/suites/mv_p0/test_dup_group_by_mv_abs/test_dup_group_by_mv_abs.groovy index 822082554fc0de..23aeeb207f6898 100644 --- a/regression-test/suites/mv_p0/test_dup_group_by_mv_abs/test_dup_group_by_mv_abs.groovy +++ b/regression-test/suites/mv_p0/test_dup_group_by_mv_abs/test_dup_group_by_mv_abs.groovy @@ -44,7 +44,6 @@ suite ("test_dup_group_by_mv_abs") { sql """analyze table d_table with sync;""" sql """set enable_stats=false;""" - sql """alter table d_table modify column k1 set stats ('row_count'='4');""" qt_select_star "select * from d_table order by k1;" mv_rewrite_success("select k1,sum(abs(k2)) from d_table group by k1;", "k12sa") @@ -54,6 +53,7 @@ suite ("test_dup_group_by_mv_abs") { qt_select_mv_sub "select sum(abs(k2)) from d_table group by k1 order by k1;" sql """set enable_stats=true;""" + sql """alter table d_table modify column k1 set stats ('row_count'='4');""" mv_rewrite_success("select k1,sum(abs(k2)) from d_table group by k1;", "k12sa") mv_rewrite_success("select sum(abs(k2)) from d_table group by k1;", "k12sa") } diff --git a/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy b/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy index cf75b0ae2b514b..ad437db464b3bb 100644 --- a/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy +++ b/regression-test/suites/mv_p0/test_dup_mv_plus/test_dup_mv_plus.groovy @@ -70,7 +70,7 @@ suite ("test_dup_mv_plus") { qt_select_mv "select k1,k2+1 from d_table order by k2;" sql """set enable_stats=true;""" - sql """alter table table_ngrambf modify column siteid set stats ('row_count'='2');""" + sql """alter table d_table modify column k4 set stats ('row_count'='3');""" mv_rewrite_success("select k1,k2+1 from d_table order by k1;", "k12p") mv_rewrite_success("select k2+1 from d_table order by k1;", "k12p") diff --git a/regression-test/suites/mv_p0/test_mv_dp/test_mv_dp.groovy b/regression-test/suites/mv_p0/test_mv_dp/test_mv_dp.groovy index 4910f606e4ef4d..2fadc0b0da91a0 100644 --- a/regression-test/suites/mv_p0/test_mv_dp/test_mv_dp.groovy +++ b/regression-test/suites/mv_p0/test_mv_dp/test_mv_dp.groovy @@ -57,7 +57,6 @@ suite ("test_mv_dp") { } */ - sql """alter table dp modify column d set stats ('row_count'='4');""" mv_rewrite_success("""select d, bitmap_union_count(bitmap_from_array(cast(uid_list as array))), bitmap_union_count(bitmap_from_array(if(status='success', cast(uid_list as array), array()))) @@ -70,6 +69,7 @@ suite ("test_mv_dp") { from dp group by d order by 1;""" sql """set enable_stats=true;""" + sql """alter table dp modify column d set stats ('row_count'='4');""" mv_rewrite_success("""select d, bitmap_union_count(bitmap_from_array(cast(uid_list as array))), bitmap_union_count(bitmap_from_array(if(status='success', cast(uid_list as array), array()))) diff --git a/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy b/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy index ae58a539a6614e..d43b5796e6d7f9 100644 --- a/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy +++ b/regression-test/suites/mv_p0/ut/testAggQuqeryOnAggMV7/testAggQuqeryOnAggMV7.groovy @@ -43,8 +43,6 @@ suite ("testAggQuqeryOnAggMV7") { sql """analyze table emps with sync;""" sql """set enable_stats=false;""" - sql """alter table emps modify column time_col set stats ('row_count'='4');""" - mv_rewrite_fail("select * from emps order by empid;", "emps_mv") qt_select_star "select * from emps order by empid;" @@ -53,6 +51,7 @@ suite ("testAggQuqeryOnAggMV7") { sql """set enable_stats=true;""" sql """alter table emps modify column time_col set stats ('row_count'='4');""" + sql """alter table emps modify column time_col set stats ('row_count'='4');""" mv_rewrite_fail("select * from emps order by empid;", "emps_mv") mv_rewrite_success("select deptno, sum(salary) from emps where deptno>=20 group by deptno;", "emps_mv") diff --git a/regression-test/suites/nereids_rules_p0/mv/agg_with_roll_up/aggregate_with_roll_up.groovy b/regression-test/suites/nereids_rules_p0/mv/agg_with_roll_up/aggregate_with_roll_up.groovy index 3c57a5079d4f21..5b8aa6e00d2308 100644 --- a/regression-test/suites/nereids_rules_p0/mv/agg_with_roll_up/aggregate_with_roll_up.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/agg_with_roll_up/aggregate_with_roll_up.groovy @@ -843,6 +843,7 @@ suite("aggregate_with_roll_up") { bitmap_union(to_bitmap(case when o_shippriority > 1 and o_orderkey IN (3, 4, 5) then o_custkey else null end)), bitmap_union_count(to_bitmap(case when o_shippriority > 0 and o_orderkey IN (1, 2, 3) then o_custkey else null end)), bitmap_union_count(to_bitmap(case when o_shippriority > 1 and o_orderkey IN (3, 4, 5) then o_custkey else null end)), + bitmap_union_count(to_bitmap(case when o_shippriority > 0 and o_orderkey IN (1, 2, 3) then o_custkey else null end)) + bitmap_union_count(to_bitmap(case when o_shippriority > 1 and o_orderkey IN (3, 4, 5) then o_custkey else null end)), count(distinct case when o_shippriority > 1 and o_orderkey IN (3, 4, 5) then o_custkey else null end) from lineitem left join orders on l_orderkey = o_orderkey and l_shipdate = o_orderdate diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy index ae8c92b7a0c3d4..f3289b007a0505 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_6.groovy @@ -124,13 +124,10 @@ suite("partition_mv_rewrite_dimension_2_6") { (3, null, 1, 99.5, 'yy'); """ - sql """insert into orders_2_6 values (...);""" sql """alter table orders_2_6 modify column o_comment set stats ('row_count'='10');""" - sql """insert into lineitem_2_6 values (...);""" sql """alter table lineitem_2_6 modify column l_comment set stats ('row_count'='7');""" - sql """insert into partsupp_2_6 values (...);""" sql """alter table partsupp_2_6 modify column ps_comment set stats ('row_count'='3');""" sql """analyze table orders_2_6 with sync;""" diff --git a/regression-test/suites/nereids_rules_p0/mv/other_join_conjuncts/outer/other_join_conjuncts_outer.groovy b/regression-test/suites/nereids_rules_p0/mv/other_join_conjuncts/outer/other_join_conjuncts_outer.groovy index 805f288d989e09..87fd620c704baf 100644 --- a/regression-test/suites/nereids_rules_p0/mv/other_join_conjuncts/outer/other_join_conjuncts_outer.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/other_join_conjuncts/outer/other_join_conjuncts_outer.groovy @@ -1376,8 +1376,9 @@ suite("other_join_conjuncts_outer") { ps_partkey from orders - full outer join lineitem on l_orderkey = o_orderkey - full outer join partsupp on ps_partkey = l_partkey; + full outer join lineitem on l_orderkey = o_orderkey and l_shipdate <= o_orderdate + full outer join partsupp on ps_partkey = l_partkey + where l_orderkey + o_orderkey != ps_availqty; """ def query9_4 = """ @@ -1389,9 +1390,8 @@ suite("other_join_conjuncts_outer") { ps_partkey from orders - full outer join lineitem on l_orderkey = o_orderkey and l_shipdate < o_orderdate - full outer join partsupp on ps_partkey = l_partkey - where l_orderkey + o_orderkey != ps_availqty; + full outer join lineitem on l_orderkey = o_orderkey + full outer join partsupp on ps_partkey = l_partkey; """ order_qt_query9_4_before "${query9_4}" // mv has other conjuncts but query not diff --git a/regression-test/suites/nereids_rules_p0/mv/single_table_without_agg/single_table_without_aggregate.groovy b/regression-test/suites/nereids_rules_p0/mv/single_table_without_agg/single_table_without_aggregate.groovy index 2730816da282cf..450fb9c0ea3187 100644 --- a/regression-test/suites/nereids_rules_p0/mv/single_table_without_agg/single_table_without_aggregate.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/single_table_without_agg/single_table_without_aggregate.groovy @@ -52,9 +52,8 @@ suite("single_table_without_aggregate") { """ sql "analyze table orders with sync;" - sql """set enable_stats=false;""" - sql """alter table orders modify column o_comment set stats ('row_count'='2');""" + sql """set enable_stats=false;""" def check_rewrite = { mv_sql, query_sql, mv_name -> diff --git a/regression-test/suites/nereids_syntax_p0/mv/ut/onStar.groovy b/regression-test/suites/nereids_syntax_p0/mv/ut/onStar.groovy index 8b133a88908e34..2e60f038e7b6d2 100644 --- a/regression-test/suites/nereids_syntax_p0/mv/ut/onStar.groovy +++ b/regression-test/suites/nereids_syntax_p0/mv/ut/onStar.groovy @@ -63,6 +63,4 @@ suite ("onStar") { sql """insert into onStar_tpch values(1,'a','a');""" order_qt_select_mv "select ref_1.`empid` as c0 from onStar_tpch as ref_0 left join onStar as ref_1 on (ref_0.`r_comment` = ref_1.`name` ) where true order by ref_0.`r_regionkey`,ref_0.`r_regionkey` desc ,ref_0.`r_regionkey`,ref_0.`r_regionkey`;" - - sql """alter table onStar_tpch modify column r_regionkey set stats ('row_count'='1');""" }