EmmyMiao87 commented on a change in pull request #7494:
URL: https://github.com/apache/incubator-doris/pull/7494#discussion_r776556011



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java
##########
@@ -193,6 +199,15 @@ public void analyzeSelectClause() throws AnalysisException 
{
                 // Function must match pattern.
                 FunctionCallExpr functionCallExpr = (FunctionCallExpr) 
selectListItemExpr;
                 String functionName = 
functionCallExpr.getFnName().getFunction();
+                // current version not support count(distinct) function in 
creating materialized view
+                if (!isReplay) {
+                    for (Map.Entry<String, MVColumnPattern> env : 
FN_NAME_TO_PATTERN.entrySet()){
+                        if (!env.getValue().match(functionCallExpr)){

Review comment:
       Each function corresponds to its own pattern. He only needs to ensure 
that his pattern is passed. It is not necessary to satisfy all patterns.

##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/analysis/MVColumnOneChildPattern.java
##########
@@ -31,6 +34,11 @@ public boolean match(Expr expr) {
             return false;
         }
         FunctionCallExpr functionCallExpr = (FunctionCallExpr) expr;
+        if 
(functionName.toLowerCase().equals(AggregateType.SUM.name().toLowerCase()) || 
functionName.toLowerCase().equals(AggregateType.MAX.name().toLowerCase()) || 
functionName.toLowerCase().equals(AggregateType.MIN.name().toLowerCase()) || 
functionName.toLowerCase().equals(FunctionSet.COUNT)) {

Review comment:
       ```suggestion
           if (functionCallExpr.isDistinct()) {
               return false;
           }
   ```




-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to