seawinde commented on code in PR #28596:
URL: https://github.com/apache/doris/pull/28596#discussion_r1431451701
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/AbstractMaterializedViewRule.java:
##########
@@ -80,40 +101,51 @@ protected List<Plan> rewrite(Plan queryPlan,
CascadesContext cascadesContext) {
if (queryPlan.getGroupExpression().isPresent()
&& materializationContext.alreadyRewrite(
queryPlan.getGroupExpression().get().getOwnerGroup().getGroupId())) {
+ logger.info(currentClassName + " this group is already
rewritten so skip");
continue;
}
- Plan mvPlan =
materializationContext.getMtmv().getCache().getLogicalPlan();
- List<StructInfo> viewStructInfos = extractStructInfo(mvPlan,
cascadesContext);
+ MTMV mtmv = materializationContext.getMTMV();
+ MTMVCache mtmvCache = getCacheFromMTMV(mtmv, cascadesContext);
+ if (mtmvCache == null) {
+ logger.info(currentClassName + " mv cache is null so return");
+ return rewriteResults;
+ }
+ List<StructInfo> viewStructInfos =
extractStructInfo(mtmvCache.getLogicalPlan(), cascadesContext);
if (viewStructInfos.size() > 1) {
// view struct info should only have one
+ logger.info(currentClassName + " the num of view struct info
is more then one so return");
Review Comment:
have fixed 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]