EmmyMiao87 commented on a change in pull request #7494: URL: https://github.com/apache/incubator-doris/pull/7494#discussion_r776318295
########## File path: fe/fe-core/src/main/java/org/apache/doris/analysis/CreateMaterializedViewStmt.java ########## @@ -193,6 +199,11 @@ 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 && functionName.toLowerCase().equals("count") && functionCallExpr.isDistinct()) { Review comment: There is really no problem with this repair. But I think a better way is: 1. Modify MVColumnOneChildPattern 2. ``` if (isReplay) { ignore pattern } else {match pattern} ``` ########## File path: fe/fe-core/src/main/java/org/apache/doris/catalog/AggregateFunction.java ########## @@ -102,6 +102,38 @@ public AggregateFunction(FunctionName fnName, List<Type> argTypes, mergeFnSymbol, getValueFnSymbol, removeFnSymbol, finalizeFnSymbol, false); } + public AggregateFunction(FunctionName fnName, List<Type> argTypes, Review comment: Adding a constructor only for UT is a less elegant behavior. If you need to use this variable in UT, but there are some attributes that you can’t use, the better way is new an object and pass in an empty string instead of adding a constructor without a default value. -- 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