seawinde commented on code in PR #38527: URL: https://github.com/apache/doris/pull/38527#discussion_r1699648295
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtils.java: ########## @@ -224,35 +223,20 @@ public static List<StructInfo> extractStructInfo(Plan plan, Plan originalPlan, C * when query rewrite, because one plan may hit the materialized view repeatedly and the mv scan output * should be different */ - public static Plan generateMvScanPlan(MTMV materializedView, CascadesContext cascadesContext) { + public static Plan generateMvScanPlan(OlapTable table, long indexId, + List<Long> partitionIds, + PreAggStatus preAggStatus, + CascadesContext cascadesContext) { return new LogicalOlapScan( cascadesContext.getStatementContext().getNextRelationId(), - materializedView, - materializedView.getFullQualifiers(), + table, + ImmutableList.of(table.getQualifiedDbName()), ImmutableList.of(), - materializedView.getPartitionIds(), - materializedView.getBaseIndexId(), - PreAggStatus.on(), - ImmutableList.of(), - // this must be empty, or it will be used to sample - ImmutableList.of(), - Optional.empty()); - } - - /** - * LIke above but generate scan plan for sync materialized view - */ - public static Plan generateMvScanPlan(OlapTable olapTable, long indexId, CascadesContext cascadesContext) { - return new LogicalOlapScan( - cascadesContext.getStatementContext().getNextRelationId(), - olapTable, - ImmutableList.of(olapTable.getQualifiedDbName()), - // this must be empty, or it will be used to sample - ImmutableList.of(), - olapTable.getPartitionIds(), + partitionIds, indexId, - PreAggStatus.unset(), + preAggStatus, Review Comment: the preAggStatus is variable. it's is `unset` when sync materialization context and is `on` when async materialization context -- 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