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

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e6f5b0e33c [case](mtmv) MTMV upgrade downgrade case (#39789)
4e6f5b0e33c is described below

commit 4e6f5b0e33c994d5e80e988720989c4f02d77eb6
Author: zhangdong <[email protected]>
AuthorDate: Thu Aug 29 11:06:50 2024 +0800

    [case](mtmv) MTMV upgrade downgrade case (#39789)
---
 .../test_upgrade_downgrade_mtmv.out                |  7 ++++
 regression-test/suites/mtmv_up_down_p0/load.groovy | 47 ++++++++++++++++++++++
 .../test_upgrade_downgrade_mtmv.groovy             | 38 +++++++++++++++++
 3 files changed, 92 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
--- /dev/null
+++ b/regression-test/data/mtmv_up_down_p0/test_upgrade_downgrade_mtmv.out
@@ -0,0 +1,7 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !refresh_init --
+1      1       1       name1                    
+
+-- !mtmv_sync --
+true
+
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to