seawinde commented on code in PR #40332: URL: https://github.com/apache/doris/pull/40332#discussion_r1749936291
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/InitMaterializationContextHook.java: ########## @@ -129,15 +131,24 @@ private List<MaterializationContext> createAsyncMaterializationContext(CascadesC Set<TableIf> usedTables) { Set<MTMV> availableMTMVs = getAvailableMTMVs(usedTables, cascadesContext); if (availableMTMVs.isEmpty()) { - LOG.debug(String.format("Enable materialized view rewrite but availableMTMVs is empty, current queryId " - + "is %s", cascadesContext.getConnectContext().getQueryIdentifier())); + LOG.debug("Enable materialized view rewrite but availableMTMVs is empty, current queryId " + + "is {}", cascadesContext.getConnectContext().getQueryIdentifier()); return ImmutableList.of(); } List<MaterializationContext> asyncMaterializationContext = new ArrayList<>(); for (MTMV materializedView : availableMTMVs) { 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)) { Review Comment: have fixed -- 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