diff --git a/regression-test/data/nereids_rules_p0/mv/external_table/part_partition_invalid.out b/regression-test/data/nereids_rules_p0/mv/external_table/part_partition_invalid.out index b2cd5c559ca77d..d70bd0bbae15c6 100644 --- a/regression-test/data/nereids_rules_p0/mv/external_table/part_partition_invalid.out +++ b/regression-test/data/nereids_rules_p0/mv/external_table/part_partition_invalid.out @@ -13,9 +13,11 @@ 1 2 1 2023-10-17 2023-10-17 2 2 2 2023-10-18 2023-10-18 3 2 3 2023-10-19 2023-10-19 +3 2 3 2023-10-19 2023-10-19 -- !after_modify_and_without_refresh_catalog_19 -- 3 2 3 2023-10-19 2023-10-19 +3 2 3 2023-10-19 2023-10-19 -- !after_modify_and_without_refresh_catalog_18 -- 2 2 2 2023-10-18 2023-10-18 @@ -24,9 +26,11 @@ 1 2 1 2023-10-17 2023-10-17 2 2 2 2023-10-18 2023-10-18 3 2 3 2023-10-19 2023-10-19 +3 2 3 2023-10-19 2023-10-19 -- !after_modify_and_refresh_catalog_19 -- 3 2 3 2023-10-19 2023-10-19 +3 2 3 2023-10-19 2023-10-19 -- !after_modify_and_refresh_catalog_18 -- 2 2 2 2023-10-18 2023-10-18 @@ -38,6 +42,7 @@ 3 2 3 2023-10-19 2023-10-19 -- !after_add_data_without_refresh_catalog -- +\N \N 7 \N 2023-10-20 1 2 1 2023-10-17 2023-10-17 2 2 2 2023-10-18 2023-10-18 3 2 3 2023-10-19 2023-10-19 @@ -48,8 +53,10 @@ 3 2 3 2023-10-19 2023-10-19 -- !after_add_and_without_refresh_catalog_20 -- +\N \N 7 \N 2023-10-20 -- !after_add_data_with_refresh_catalog -- +\N \N 7 \N 2023-10-20 1 2 1 2023-10-17 2023-10-17 2 2 2 2023-10-18 2023-10-18 3 2 3 2023-10-19 2023-10-19 @@ -60,6 +67,7 @@ 3 2 3 2023-10-19 2023-10-19 -- !after_add_and_refresh_catalog_20 -- +\N \N 7 \N 2023-10-20 -- !after_add_data_and_refresh_catalog_and_mv -- \N \N 7 \N 2023-10-20 diff --git a/regression-test/suites/nereids_rules_p0/mv/external_table/part_partition_invalid.groovy b/regression-test/suites/nereids_rules_p0/mv/external_table/part_partition_invalid.groovy index 4d02edec19562a..43cde7c927c9ac 100644 --- a/regression-test/suites/nereids_rules_p0/mv/external_table/part_partition_invalid.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/external_table/part_partition_invalid.groovy @@ -16,7 +16,7 @@ package mv.external_table // specific language governing permissions and limitations // under the License. -suite("part_partition_invalid", "p0,external") { +suite("part_partition_invalid", "p0,external,external_docker") { String enabled = context.config.otherConfigs.get("enableHiveTest") if (enabled == null || !enabled.equalsIgnoreCase("true")) { logger.info("diable Hive test. then doesn't test mv rewrite") @@ -141,7 +141,7 @@ suite("part_partition_invalid", "p0,external") { // test query rewrite by mv, should fail ,because materialized_view_rewrite_enable_contain_external_table // is false default - mv_rewrite_fail(query_sql, mv_name) + mv_not_part_in(query_sql, mv_name) sql "SET materialized_view_rewrite_enable_contain_external_table=true" mv_rewrite_success(query_sql, mv_name) @@ -151,7 +151,8 @@ suite("part_partition_invalid", "p0,external") { mv_rewrite_success(query_sql, mv_name) order_qt_after_modify_data_without_refresh_catalog """ ${query_sql}""" - mv_rewrite_success(""" + // query invalid partition data, should hit mv, because not check now. + mv_rewrite_fail(""" ${query_sql} where o_orderdate = '2023-10-19'; """, mv_name) order_qt_after_modify_and_without_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';""" @@ -169,7 +170,7 @@ suite("part_partition_invalid", "p0,external") { order_qt_after_modify_data_and_refresh_catalog """ ${query_sql}""" // query invalid partition data, should hit mv, because not check now. - mv_rewrite_success(""" + mv_rewrite_fail(""" ${query_sql} where o_orderdate = '2023-10-19'; """, mv_name) order_qt_after_modify_and_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';""" @@ -197,8 +198,8 @@ suite("part_partition_invalid", "p0,external") { order_qt_after_add_and_without_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';""" - // query valid partition data, should hit mv - mv_rewrite_success(""" + // query valid partition data, should hit mv, because data not aware + mv_rewrite_fail(""" ${query_sql} where o_orderdate = '2023-10-20'; """, mv_name) @@ -217,7 +218,7 @@ suite("part_partition_invalid", "p0,external") { order_qt_after_add_and_refresh_catalog_19 """ ${query_sql} where o_orderdate = '2023-10-19';""" // query valid partition data, should hit mv - mv_rewrite_success(""" + mv_rewrite_fail(""" ${query_sql} where o_orderdate = '2023-10-20'; """, mv_name) order_qt_after_add_and_refresh_catalog_20 """ ${query_sql} where o_orderdate = '2023-10-20';""" diff --git a/regression-test/suites/nereids_rules_p0/mv/is_in_debug_mode/is_in_debug_mode.groovy b/regression-test/suites/nereids_rules_p0/mv/is_in_debug_mode/is_in_debug_mode.groovy index f973d031adeee0..ebc1921c0ab6ae 100644 --- a/regression-test/suites/nereids_rules_p0/mv/is_in_debug_mode/is_in_debug_mode.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/is_in_debug_mode/is_in_debug_mode.groovy @@ -74,7 +74,8 @@ suite("is_in_debug_mode") { sql """set skip_delete_sign = true;""" mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv") - try { + logger.info("skip_delete_sign session is " + sql("show variables like '%skip_delete_sign%'")) + test { sql """ CREATE MATERIALIZED VIEW test_create_mv BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL @@ -82,17 +83,15 @@ suite("is_in_debug_mode") { PROPERTIES ('replication_num' = '1') AS select * from orders where o_orderkey > 2; """ - } catch (Exception e) { - def message = e.getMessage() - logger.info("test_create_mv1" + message) - Assert.assertTrue(message.contains("because is in debug mode")) + exception "because is in debug mode" } sql """set skip_delete_sign = false;""" sql """set skip_storage_engine_merge = true;""" mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv") - try { + logger.info("skip_storage_engine_merge session is " + sql("show variables like '%skip_storage_engine_merge%'")) + test { sql """ CREATE MATERIALIZED VIEW test_create_mv BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL @@ -100,17 +99,15 @@ suite("is_in_debug_mode") { PROPERTIES ('replication_num' = '1') AS select * from orders where o_orderkey > 2; """ - } catch (Exception e) { - def message = e.getMessage() - logger.info("test_create_mv2" + message) - Assert.assertTrue(message.contains("because is in debug mode")) + exception "because is in debug mode" } sql """set skip_storage_engine_merge = false;""" sql """set skip_delete_bitmap = true;""" mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv") - try { + logger.info("skip_delete_bitmap session is " + sql("show variables like '%skip_delete_bitmap%'")) + test { sql """ CREATE MATERIALIZED VIEW test_create_mv BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL @@ -118,17 +115,15 @@ suite("is_in_debug_mode") { PROPERTIES ('replication_num' = '1') AS select * from orders where o_orderkey > 2; """ - } catch (Exception e) { - def message = e.getMessage() - logger.info("test_create_mv3: " + message) - Assert.assertTrue(message.contains("because is in debug mode")) + exception "because is in debug mode" } sql """set skip_delete_bitmap = false;""" sql """set skip_delete_predicate = true;""" mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv") - try { + logger.info("skip_delete_predicate session is " + sql("show variables like '%skip_delete_predicate%'")) + test { sql """ CREATE MATERIALIZED VIEW test_create_mv BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL @@ -136,17 +131,15 @@ suite("is_in_debug_mode") { PROPERTIES ('replication_num' = '1') AS select * from orders where o_orderkey > 2; """ - } catch (Exception e) { - def message = e.getMessage() - logger.info("test_create_mv4" + message) - Assert.assertTrue(message.contains("because is in debug mode")) + exception "because is in debug mode" } sql """set skip_delete_predicate = false;""" sql """set show_hidden_columns = true;""" mv_not_part_in("""select * from orders where o_orderkey > 1;""", "basic_mv") - try { + logger.info("show_hidden_columns session is " + sql("show variables like '%show_hidden_columns%'")) + test { sql """ CREATE MATERIALIZED VIEW test_create_mv BUILD IMMEDIATE REFRESH COMPLETE ON MANUAL @@ -154,10 +147,7 @@ suite("is_in_debug_mode") { PROPERTIES ('replication_num' = '1') AS select * from orders where o_orderkey > 2; """ - } catch (Exception e) { - def message = e.getMessage() - logger.info("test_create_mv5" + message) - Assert.assertTrue(message.contains("because is in debug mode")) + exception "because is in debug mode" } sql """set show_hidden_columns = false;""" diff --git a/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy b/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy index 4e74090b1a2bb2..a5bc5586e518e6 100644 --- a/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/union_rewrite/usercase_union_rewrite.groovy @@ -75,8 +75,11 @@ suite ("usercase_union_rewrite") { sql """ insert into orders_user values (1, 3, 'o', 99.5, 'a', 'b', null, 'yy', '2023-10-19'), + (1, 3, 'o', 99.5, 'a', 'b', null, 'yy', '2023-10-19'), + (2, 1, 'o', 109.2, 'c','d',2, null, '2023-10-18'), (2, 1, 'o', 109.2, 'c','d',2, null, '2023-10-18'), (3, 2, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-17'), + (3, 2, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-17'), (4, 5, 'k', 99.5, 'a', 'b', 1, 'yy', '2023-10-19'); """