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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9864a5d  [Enhance] Modify the error message when mv column is 
transformed from base column in agg family table (#5084)
9864a5d is described below

commit 9864a5d818396e7a026f8cd8201878749cb6a4e3
Author: EmmyMiao87 <522274...@qq.com>
AuthorDate: Thu Dec 17 00:33:27 2020 +0800

    [Enhance] Modify the error message when mv column is transformed from base 
column in agg family table (#5084)
    
    When user wants to create materialized view with a mv column which is 
transformed
    from original column in agg family table, Doris will throw a new error 
message
    "The mv column of agg or uniq table cannot be transformed from original 
column"
    instead of "column not exists".
---
 .../src/main/java/org/apache/doris/alter/MaterializedViewHandler.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java 
b/fe/fe-core/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java
index 1e0c14f..917e800 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java
@@ -444,6 +444,10 @@ public class MaterializedViewHandler extends AlterHandler {
                 if (mvColumnItem.isKey()) {
                     ++numOfKeys;
                 }
+                if (baseColumn == null) {
+                    throw new DdlException("The mv column of agg or uniq table 
cannot be transformed "
+                            + "from original column[" + 
mvColumnItem.getBaseColumnName() + "]");
+                }
                 Preconditions.checkNotNull(baseColumn, "Column[" + 
mvColumnName + "] does not exist");
                 AggregateType baseAggregationType = 
baseColumn.getAggregationType();
                 AggregateType mvAggregationType = 
mvColumnItem.getAggregationType();


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

Reply via email to