This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new cc0339a6abb branch-2.1: [case](mtmv)MTMV upgrade downgrade case #39789 
(#48185)
cc0339a6abb is described below

commit cc0339a6abb1017a69f6d9174f20e40c47d7704d
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Feb 22 13:33:08 2025 +0800

    branch-2.1: [case](mtmv)MTMV upgrade downgrade case #39789 (#48185)
    
    Cherry-picked from #39789
    
    Co-authored-by: zhangdong <493738...@qq.com>
---
 .../test_upgrade_downgrade_mtmv.out                | Bin 0 -> 171 bytes
 regression-test/suites/mtmv_up_down_p0/load.groovy |  47 +++++++++++++++++++++
 .../test_upgrade_downgrade_mtmv.groovy             |  38 +++++++++++++++++
 3 files changed, 85 insertions(+)

diff --git 
a/regression-test/data/mtmv_up_down_p0/test_upgrade_downgrade_mtmv.out 
b/regression-test/data/mtmv_up_down_p0/test_upgrade_downgrade_mtmv.out
new file mode 100644
index 00000000000..3c49cb862ed
Binary files /dev/null and 
b/regression-test/data/mtmv_up_down_p0/test_upgrade_downgrade_mtmv.out differ
diff --git a/regression-test/suites/mtmv_up_down_p0/load.groovy 
b/regression-test/suites/mtmv_up_down_p0/load.groovy
new file mode 100644
index 00000000000..45a309ae0a7
--- /dev/null
+++ b/regression-test/suites/mtmv_up_down_p0/load.groovy
@@ -0,0 +1,47 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_upgrade_downgrade_prepare_mtmv","p0,mtmv,restart_fe,external,hive,external_docker,external_docker_hive")
 {
+    String enabled = context.config.otherConfigs.get("enableHiveTest")
+    if (enabled == null || !enabled.equalsIgnoreCase("true")) {
+        logger.info("diable Hive test.")
+        return;
+    }
+    String suiteName = "mtmv_up_down"
+    String hivePrefix = "hive2";
+    String hms_port = context.config.otherConfigs.get(hivePrefix + "HmsPort")
+    String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+    String catalog_name = "${hivePrefix}_${suiteName}_catalog"
+    String mvName = "${hivePrefix}_${suiteName}_mtmv"
+
+    sql """drop catalog if exists ${catalog_name}"""
+    sql """create catalog if not exists ${catalog_name} properties (
+        "type"="hms",
+        'hive.metastore.uris' = 'thrift://${externalEnvIp}:${hms_port}'
+    );"""
+    sql """drop materialized view if exists ${mvName};"""
+
+    sql """
+        create MATERIALIZED VIEW ${mvName}
+        REFRESH auto ON MANUAL
+        partition by(part1)
+        DISTRIBUTED BY RANDOM BUCKETS AUTO
+        PROPERTIES ('replication_num' = '1')
+        as select * from ${catalog_name}.multi_catalog.one_partition a inner 
join ${catalog_name}.multi_catalog.region b on a.id=b.r_regionkey;
+        """
+    waitingMTMVTaskFinishedByMvName(mvName)
+}
diff --git 
a/regression-test/suites/mtmv_up_down_p0/test_upgrade_downgrade_mtmv.groovy 
b/regression-test/suites/mtmv_up_down_p0/test_upgrade_downgrade_mtmv.groovy
new file mode 100644
index 00000000000..a49bda71202
--- /dev/null
+++ b/regression-test/suites/mtmv_up_down_p0/test_upgrade_downgrade_mtmv.groovy
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_upgrade_downgrade_mtmv","p0,mtmv,restart_fe,external,hive,external_docker,external_docker_hive")
 {
+    String enabled = context.config.otherConfigs.get("enableHiveTest")
+    if (enabled == null || !enabled.equalsIgnoreCase("true")) {
+        logger.info("diable Hive test.")
+        return;
+    }
+    String suiteName = "mtmv_up_down"
+    String dbName = context.config.getDbNameByFile(context.file)
+    String hivePrefix = "hive2";
+    String catalog_name = "${hivePrefix}_${suiteName}_catalog"
+    String mvName = "${hivePrefix}_${suiteName}_mtmv"
+    // test data is normal
+    order_qt_refresh_init "SELECT * FROM ${mvName}"
+    // test is sync
+    order_qt_mtmv_sync "select SyncWithBaseTables from 
mv_infos('database'='${dbName}') where Name='${mvName}'"
+     sql """
+            REFRESH MATERIALIZED VIEW ${mvName} complete
+        """
+    // test can refresh success
+    waitingMTMVTaskFinishedByMvName(mvName)
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to