From 2272bd8fa35c52ff92353416685e65dfe1ae7052 Mon Sep 17 00:00:00 2001 From: suxiaogang223 Date: Fri, 12 Apr 2024 16:21:05 +0800 Subject: [PATCH] fix test for hive3 about hive.stats.column.autogather --- .../suites/mtmv_p0/test_hive_multi_partition_mtmv.groovy | 6 ++++++ .../suites/mtmv_p0/test_hive_refresh_mtmv.groovy | 8 ++++++++ .../mv/external_table/mv_contain_external_table.groovy | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/regression-test/suites/mtmv_p0/test_hive_multi_partition_mtmv.groovy b/regression-test/suites/mtmv_p0/test_hive_multi_partition_mtmv.groovy index c8e5830dcacc60..269bf95a34d38a 100644 --- a/regression-test/suites/mtmv_p0/test_hive_multi_partition_mtmv.groovy +++ b/regression-test/suites/mtmv_p0/test_hive_multi_partition_mtmv.groovy @@ -25,6 +25,8 @@ suite("test_hive_multi_partition_mtmv", "p0,external,hive,external_docker,extern def hive_database = "test_hive_multi_partition_mtmv_db" def hive_table = "partition2" + def autogather_off_str = """ set hive.stats.column.autogather = false; """ + def autogather_on_str = """ set hive.stats.column.autogather = true; """ def drop_table_str = """ drop table if exists ${hive_database}.${hive_table} """ def drop_database_str = """ drop database if exists ${hive_database}""" def create_database_str = """ create database ${hive_database}""" @@ -51,6 +53,8 @@ suite("test_hive_multi_partition_mtmv", "p0,external,hive,external_docker,extern def insert_str5 = """insert into ${hive_database}.${hive_table} PARTITION(year=2022,region="bj") values(5)""" def insert_str6 = """insert into ${hive_database}.${hive_table} PARTITION(year=2022,region="sh") values(6)""" + logger.info("hive sql: " + autogather_off_str) + hive_docker """ ${autogather_off_str} """ logger.info("hive sql: " + drop_table_str) hive_docker """ ${drop_table_str} """ logger.info("hive sql: " + drop_database_str) @@ -247,6 +251,8 @@ suite("test_hive_multi_partition_mtmv", "p0,external,hive,external_docker,extern assertTrue(showPartitionsResult.toString().contains("p_sh")) assertFalse(showPartitionsResult.toString().contains("p_tj")) + logger.info("hive sql: " + autogather_on_str) + hive_docker """ ${autogather_on_str} """ sql """drop materialized view if exists ${mvName};""" sql """drop catalog if exists ${catalog_name}""" } diff --git a/regression-test/suites/mtmv_p0/test_hive_refresh_mtmv.groovy b/regression-test/suites/mtmv_p0/test_hive_refresh_mtmv.groovy index 616ff77ca9a852..23135ea62a09cc 100644 --- a/regression-test/suites/mtmv_p0/test_hive_refresh_mtmv.groovy +++ b/regression-test/suites/mtmv_p0/test_hive_refresh_mtmv.groovy @@ -25,6 +25,8 @@ suite("test_hive_refresh_mtmv", "p0,external,hive,external_docker,external_docke def hive_database = "mtmv_test_db" def hive_table = "test_hive_refresh_mtmv_t1" + def autogather_off_str = """ set hive.stats.column.autogather = false; """ + def autogather_on_str = """ set hive.stats.column.autogather = true; """ def drop_table_str = """ drop table if exists ${hive_database}.${hive_table} """ def drop_database_str = """ drop database if exists ${hive_database}""" def create_database_str = """ create database ${hive_database}""" @@ -40,6 +42,9 @@ suite("test_hive_refresh_mtmv", "p0,external,hive,external_docker,external_docke partition(year=2020); """ def insert_str = """ insert into ${hive_database}.${hive_table} PARTITION(year=2020) values(1,1)""" + + logger.info("hive sql: " + autogather_off_str) + hive_docker """ ${autogather_off_str} """ logger.info("hive sql: " + drop_table_str) hive_docker """ ${drop_table_str} """ logger.info("hive sql: " + drop_database_str) @@ -173,6 +178,9 @@ suite("test_hive_refresh_mtmv", "p0,external,hive,external_docker,external_docke waitingMTMVTaskFinishedNotNeedSuccess(jobName) order_qt_task_recover "select Status from tasks('type'='mv') where JobName = '${jobName}' order by CreateTime DESC limit 1" + logger.info("hive sql: " + autogather_on_str) + hive_docker """ ${autogather_on_str} """ + sql """drop materialized view if exists ${mvName};""" sql """drop catalog if exists ${catalog_name}""" diff --git a/regression-test/suites/nereids_rules_p0/mv/external_table/mv_contain_external_table.groovy b/regression-test/suites/nereids_rules_p0/mv/external_table/mv_contain_external_table.groovy index 392997a82b9192..fc630a0e4ebf55 100644 --- a/regression-test/suites/nereids_rules_p0/mv/external_table/mv_contain_external_table.groovy +++ b/regression-test/suites/nereids_rules_p0/mv/external_table/mv_contain_external_table.groovy @@ -25,6 +25,8 @@ suite("mv_contain_external_table", "p0,external,hive,external_docker,external_do def hive_database = "test_mv_contain_external_table_rewrite_db" def hive_table = "orders" + def autogather_off_str = """ set hive.stats.column.autogather = false; """ + def autogather_on_str = """ set hive.stats.column.autogather = true; """ def drop_table_str = """ drop table if exists ${hive_database}.${hive_table} """ def drop_database_str = """ drop database if exists ${hive_database}""" def create_database_str = """ create database ${hive_database}""" @@ -60,6 +62,7 @@ suite("mv_contain_external_table", "p0,external,hive,external_docker,external_do def insert_str3 = """ insert into ${hive_database}.${hive_table} PARTITION(o_orderdate='2023-10-19') values(3, 3, 'ok', 99.5, 'a', 'b', 1, 'yy')""" + hive_docker """ ${autogather_off_str} """ hive_docker """ ${drop_table_str} """ hive_docker """ ${drop_database_str} """ hive_docker """ ${create_database_str}""" @@ -211,6 +214,7 @@ suite("mv_contain_external_table", "p0,external,hive,external_docker,external_do } order_qt_query_rewritten_with_new_data """ ${query_sql}""" + hive_docker """ ${autogather_on_str} """ sql """drop materialized view if exists ${mv_name};""" sql """drop catalog if exists ${catalog_name}""" }