seawinde commented on code in PR #40332: URL: https://github.com/apache/doris/pull/40332#discussion_r1746898916
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/InitMaterializationContextHook.java: ########## @@ -138,6 +140,16 @@ private List<MaterializationContext> createAsyncMaterializationContext(CascadesC MTMVCache mtmvCache = null; try { mtmvCache = materializedView.getOrGenerateCache(cascadesContext.getConnectContext()); + // If mv property use_for_rewrite is set false, should not partition in + // query rewrite by materialized view + String usedForRewrite = materializedView.getMvProperties().get( + PropertyAnalyzer.PROPERTIES_USE_FOR_REWRITE); + if (!StringUtils.isEmpty(usedForRewrite) && !Boolean.parseBoolean(usedForRewrite)) { + LOG.debug(String.format("mv doesn't part in query rewrite process because " + + "use_for_rewrite is false, mv is %s", + materializedView.getName())); 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: 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