adonis0147 commented on code in PR #11646: URL: https://github.com/apache/doris/pull/11646#discussion_r952207237
########## fe/fe-core/src/main/java/org/apache/doris/analysis/CreateMultiTableMaterializedViewStmt.java: ########## @@ -17,35 +17,126 @@ package org.apache.doris.analysis; +import org.apache.doris.analysis.ColumnDef.DefaultValue; +import org.apache.doris.catalog.Column; +import org.apache.doris.catalog.Database; +import org.apache.doris.catalog.Env; +import org.apache.doris.catalog.OlapTable; +import org.apache.doris.common.AnalysisException; +import org.apache.doris.common.DdlException; +import org.apache.doris.common.ErrorCode; +import org.apache.doris.common.ErrorReport; import org.apache.doris.common.UserException; import org.apache.doris.common.util.PrintableMap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; -public class CreateMultiTableMaterializedViewStmt extends DdlStmt { - private String mvName; - private MVRefreshInfo.BuildMode buildMethod; - private MVRefreshInfo refreshInfo; - private PartitionDesc partition; - private DistributionDesc distribution; - private Map<String, String> tblProperties; - private QueryStmt queryStmt; +public class CreateMultiTableMaterializedViewStmt extends CreateTableStmt { + private final String mvName; + private final MVRefreshInfo.BuildMode buildMethod; + private final MVRefreshInfo refreshInfo; + private final QueryStmt queryStmt; + private Database database; + private final Map<String, OlapTable> olapTables = Maps.newHashMap(); public CreateMultiTableMaterializedViewStmt(String mvName, MVRefreshInfo.BuildMode buildMethod, - MVRefreshInfo refreshInfo, PartitionDesc partition, DistributionDesc distribution, - Map<String, String> tblProperties, QueryStmt queryStmt) { + MVRefreshInfo refreshInfo, KeysDesc keyDesc, PartitionDesc partitionDesc, DistributionDesc distributionDesc, + Map<String, String> properties, QueryStmt queryStmt) { this.mvName = mvName; this.buildMethod = buildMethod; this.refreshInfo = refreshInfo; - this.partition = partition; - this.distribution = distribution; - this.tblProperties = tblProperties; this.queryStmt = queryStmt; + + this.keysDesc = keyDesc; + this.partitionDesc = partitionDesc; + this.distributionDesc = distributionDesc; + this.properties = properties; } @Override public void analyze(Analyzer analyzer) throws UserException { refreshInfo.analyze(analyzer); + queryStmt.analyze(analyzer); + if (queryStmt instanceof SelectStmt) { + analyzeSelectClause((SelectStmt) queryStmt); + } + tableName = new TableName(null, database.getFullName(), mvName); + super.analyze(analyzer); Review Comment: Because `CreateMultiTableMaterializedViewStmt` inherits from `CreateTableStmt`, we should set the `tableName` before analyze it. -- 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