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

yiguolei 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 939575f5f3 [fix](mtmv)create mtmv failed when not specifying refresh 
strategy #20696
939575f5f3 is described below

commit 939575f5f37869805be5ebe8a7e5a26ab1dc3aa7
Author: zhangdong <[email protected]>
AuthorDate: Tue Jun 13 08:53:24 2023 +0800

    [fix](mtmv)create mtmv failed when not specifying refresh strategy #20696
    
    * fix no refresh error
    
    * add ut
---
 fe/fe-core/src/main/cup/sql_parser.cup                 |  2 +-
 .../doris/catalog/MultiTableMaterializedViewTest.java  | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index 6c1a528990..b97a72f2b7 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -1736,7 +1736,7 @@ opt_refresh_trigger ::=
 
 opt_mv_refersh_info ::=
     {:
-        RESULT = null;
+        RESULT = new MVRefreshInfo(true);
     :}
     | KW_REFRESH opt_refresh_method:refreshMethod 
opt_refresh_trigger:refreshTrigger
     {:
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/catalog/MultiTableMaterializedViewTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/catalog/MultiTableMaterializedViewTest.java
index d1c16064ed..8cb5d14c4a 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/catalog/MultiTableMaterializedViewTest.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/catalog/MultiTableMaterializedViewTest.java
@@ -554,4 +554,22 @@ public class MultiTableMaterializedViewTest extends 
TestWithFeService {
                 + "AS SELECT t1.* FROM t_user t1").execute();
         Assertions.assertNull(connectContext.getState().getErrorCode(), 
connectContext.getState().getErrorMessage());
     }
+
+    @Test
+    void testCreateWithoutRefreshInfo() throws Exception {
+        createTable("CREATE TABLE t_user ("
+                + "  event_day DATE,"
+                + "  id bigint,"
+                + "  username varchar(20)"
+                + ")"
+                + "DISTRIBUTED BY HASH(id) BUCKETS 10 "
+                + "PROPERTIES ('replication_num' = '1')"
+        );
+        new StmtExecutor(connectContext, "CREATE MATERIALIZED VIEW mv "
+                + "BUILD DEFERRED "
+                + "DISTRIBUTED BY HASH(username) BUCKETS 10 "
+                + "PROPERTIES ('replication_num' = '1') "
+                + "AS SELECT t1.* FROM t_user t1").execute();
+        Assertions.assertNull(connectContext.getState().getErrorCode(), 
connectContext.getState().getErrorMessage());
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to