diff --git a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy index e38ef749ea8ed6b..1922244816c72ea 100644 --- a/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/dimension/dimension_2_full_join.groovy @@ -243,10 +243,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("current index j:" + j) if (j in [0, 2, 4, 5, 6, 8, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -259,10 +256,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [1, 3, 4, 5, 7, 9, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -275,10 +269,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [2, 4, 5, 8, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -291,10 +282,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [3, 4, 5, 9, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -307,10 +295,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [4, 5, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -323,10 +308,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [5, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -339,10 +321,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [0, 2, 4, 5, 6, 8, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -355,10 +334,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [1, 3, 4, 5, 7, 9, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -371,10 +347,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [2, 4, 5, 8, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -387,10 +360,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [3, 4, 5, 9, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -403,10 +373,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [4, 5, 10, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { @@ -419,10 +386,7 @@ suite("partition_mv_rewrite_dimension_2_full_join") { for (int j = 0; j < mv_list_1.size(); j++) { logger.info("j:" + j) if (j in [5, 11]) { - explain { - sql("${mv_list_1[j]}") - contains "${mv_name}(${mv_name})" - } + mv_rewrite_success(mv_list_1[j], mv_name) compare_res(mv_list_1[j] + " order by 1,2,3,4,5") } else { explain { diff --git a/regression-test/suites/nereids_rules_p0/mv/join_infer_derive/inner_join_infer_and_derive.groovy b/regression-test/suites/nereids_rules_p0/mv/join_infer_derive/inner_join_infer_and_derive.groovy index 766f656adb617d9..640715d79f090da 100644 --- a/regression-test/suites/nereids_rules_p0/mv/join_infer_derive/inner_join_infer_and_derive.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/join_infer_derive/inner_join_infer_and_derive.groovy @@ -233,15 +233,9 @@ suite("inner_join_infer_and_derive") { for (int i = 0; i < query_list.size(); i++) { logger.info("i: " + i) if (i in [0, 2, 5, 6, 8, 11]) { - explain { - sql("${query_list[i]}") - notContains "${mv_name_1}(${mv_name_1})" - } + mv_rewrite_fail(query_list[i], mv_name_1) } else { - explain { - sql("${query_list[i]}") - contains "${mv_name_1}(${mv_name_1})" - } + mv_rewrite_success(query_list[i], mv_name_1) compare_res(query_list[i] + order_stmt) } } @@ -249,15 +243,9 @@ suite("inner_join_infer_and_derive") { for (int i = 0; i < query_list.size(); i++) { logger.info("i: " + i) if (i in [1, 3, 4, 7, 9, 10]) { - explain { - sql("${query_list[i]}") - notContains "${mv_name_1}(${mv_name_1})" - } + mv_rewrite_fail(query_list[i], mv_name_1) } else { - explain { - sql("${query_list[i]}") - contains "${mv_name_1}(${mv_name_1})" - } + mv_rewrite_success(query_list[i], mv_name_1) compare_res(query_list[i] + order_stmt) } } @@ -265,16 +253,10 @@ suite("inner_join_infer_and_derive") { for (int i = 0; i < query_list.size(); i++) { logger.info("i: " + i) if (i in [12, 13]) { - explain { - sql("${query_list[i]}") - contains "${mv_name_1}(${mv_name_1})" - } + mv_rewrite_success(query_list[i], mv_name_1) compare_res(query_list[i] + order_stmt) } else { - explain { - sql("${query_list[i]}") - notContains "${mv_name_1}(${mv_name_1})" - } + mv_rewrite_fail(query_list[i], mv_name_1) } } } diff --git a/regression-test/suites/nereids_rules_p0/mv_up_down/test_mtmv_job_and_hit.groovy b/regression-test/suites/nereids_rules_p0/mv_up_down/test_mtmv_job_and_hit.groovy index 3481e778e808d37..494397a2b22034e 100644 --- a/regression-test/suites/nereids_rules_p0/mv_up_down/test_mtmv_job_and_hit.groovy +++ b/regression-test/suites/nereids_rules_p0/mv_up_down/test_mtmv_job_and_hit.groovy @@ -38,6 +38,9 @@ suite("test_upgrade_downgrade_compatibility_mtmv","p0,mtmv,restart_fe") { } } + // Reject fallback + sql """set enable_fallback_to_original_planner = false;""" + String mtmv_sql = """select l_Shipdate, o_Orderdate, l_partkey, l_suppkey from ${lineitem_tb} left join ${orders_tb} @@ -110,11 +113,9 @@ suite("test_upgrade_downgrade_compatibility_mtmv","p0,mtmv,restart_fe") { // drop sql """DROP MATERIALIZED VIEW IF EXISTS ${mtmv_name};""" sql """DROP TABLE IF EXISTS ${mtmv_name}""" - - try { + test { sql """select count(*) from ${mtmv_name}""" - } catch (Exception e) { - assertTrue(e.getMessage().contains("does not exist") || e.getMessage().contains("Unknown table")) + exception "does not exist" } // create