seawinde commented on code in PR #38527: URL: https://github.com/apache/doris/pull/38527#discussion_r1701028985
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/SyncMaterializationContext.java: ########## @@ -96,13 +99,29 @@ String getStringInfo() { @Override Optional<Pair<Id, Statistics>> getPlanStatistics(CascadesContext cascadesContext) { RelationId relationId = null; - Optional<LogicalOlapScan> scanObj = this.getScanPlan().collectFirst(LogicalOlapScan.class::isInstance); + Optional<LogicalOlapScan> scanObj = this.getScanPlan(null) + .collectFirst(LogicalOlapScan.class::isInstance); if (scanObj.isPresent()) { relationId = scanObj.get().getRelationId(); } return Optional.of(Pair.of(relationId, normalizeStatisticsColumnExpression(statistics))); } + @Override + public Plan getScanPlan(StructInfo queryStructInfo) { + if (queryStructInfo == null) { + return scanPlan; + } + if (queryStructInfo.getRelations().size() == 1 + && queryStructInfo.getRelations().get(0) instanceof LogicalOlapScan Review Comment: Yeah, we can collect the `LogicalDeferMaterializeOlapScan` when collect the struct info ```java private static class RelationCollector extends DefaultPlanVisitor<Void, List<CatalogRelation>> { @Override public Void visit(Plan plan, List<CatalogRelation> collectedRelations) { if (plan instanceof CatalogRelation) { collectedRelations.add((CatalogRelation) plan); } return super.visit(plan, collectedRelations); } } ``` -- 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