morningman commented on a change in pull request #2821: The new materialized 
view selector
URL: https://github.com/apache/incubator-doris/pull/2821#discussion_r383719225
 
 

 ##########
 File path: 
fe/src/test/java/org/apache/doris/planner/MaterializedViewFunctionTest.java
 ##########
 @@ -0,0 +1,562 @@
+// 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.
+
+package org.apache.doris.planner;
+
+import org.apache.doris.utframe.DorisAssert;
+import org.apache.doris.utframe.UtFrameUtils;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.UUID;
+
+public class MaterializedViewFunctionTest {
+    private static String runningDir = "fe/mocked/DemoTest/" + 
UUID.randomUUID().toString() + "/";
+    private static final String EMPS_TABLE_NAME = "emps";
+    private static final String EMPS_MV_NAME = "emps_mv";
+    private static final String HR_DB_NAME = "db1";
+    private static final String QUERY_USE_EMPS_MV = "rollup: " + EMPS_MV_NAME;
+    private static final String QUERY_USE_EMPS = "rollup: " + EMPS_TABLE_NAME;
+    private static final String DEPTS_TABLE_NAME = "depts";
+    private static final String DEPTS_MV_NAME = "depts_mv";
+    private static final String QUERY_USE_DEPTS_MV = "rollup: " + 
DEPTS_MV_NAME;
+    private static final String QUERY_USE_DEPTS = "rollup: " + 
DEPTS_TABLE_NAME;
+    private static DorisAssert dorisAssert;
+
+    @BeforeClass
+    public static void beforeClass() throws Exception {
+        UtFrameUtils.createMinDorisCluster(runningDir);
+        dorisAssert = new DorisAssert();
+        
dorisAssert.withEnableMV().withDatabase(HR_DB_NAME).useDatabase(HR_DB_NAME);
+    }
+
+    @Before
+    public void beforeMethod() throws Exception {
+        String createTableSQL = "create table " + HR_DB_NAME + "." + 
EMPS_TABLE_NAME + " (empid int, name varchar, "
+                + "deptno int, salary int, commission int) " + "distributed by 
hash(empid) buckets 3 properties('replication_num' = '1');";
+        dorisAssert.withTable(createTableSQL);
+        createTableSQL = "create table " + HR_DB_NAME + "." + DEPTS_TABLE_NAME 
+ " (deptno int, name varchar, cost "
+                + "int) " + "distributed by hash(deptno) buckets 3 
properties('replication_num' = '1');";
+        dorisAssert.withTable(createTableSQL);
+    }
+
+    @After
+    public void afterMethod() throws Exception {
+        dorisAssert.dropTable(EMPS_TABLE_NAME);
+        dorisAssert.dropTable(DEPTS_TABLE_NAME);
 
 Review comment:
   No need to drop it. But instead you need to remove the dir: `runningDir`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to