HangyuanLiu commented on a change in pull request #4014: URL: https://github.com/apache/incubator-doris/pull/4014#discussion_r451486342
########## File path: fe/src/main/java/org/apache/doris/analysis/MVColumnItem.java ########## @@ -79,4 +94,19 @@ public Expr getDefineExpr() { public void setDefineExpr(Expr defineExpr) { this.defineExpr = defineExpr; } + + public Column toMVColumn(OlapTable olapTable) throws DdlException { + Column baseColumn = olapTable.getColumn(name); + if (baseColumn == null) { + Preconditions.checkNotNull(defineExpr != null); + Column result = new Column(name, type, isKey, aggregationType, ColumnDef.DefaultValue.ZERO, ""); + result.setDefineExpr(defineExpr); + return result; + } else { Review comment: baseColumn may be is not null , but we should set define expr in column. such as two different materialized view aggregate function use same base filed . ---------------------------------------------------------------- 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 --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org