seawinde commented on code in PR #56266:
URL: https://github.com/apache/doris/pull/56266#discussion_r2485213218


##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPlanUtil.java:
##########
@@ -92,8 +92,26 @@
 
 public class MTMVPlanUtil {
 
-    public static ConnectContext createMTMVContext(MTMV mtmv) {
-        ConnectContext ctx = createBasicMvContext(null);
+    // The rules should be disabled when generate MTMV cache
+    // Because these rules may change the plan structure and cause the plan 
can not match the mv
+    public static final List<RuleType> DISABLE_RULES_WHEN_GENERATE_MTMV_CACHE 
= ImmutableList.of(
+            RuleType.COMPRESSED_MATERIALIZE_AGG,
+            RuleType.COMPRESSED_MATERIALIZE_SORT,
+            RuleType.ELIMINATE_CONST_JOIN_CONDITION,
+            RuleType.CONSTANT_PROPAGATION,
+            RuleType.ADD_DEFAULT_LIMIT,
+            RuleType.ELIMINATE_GROUP_BY,
+            RuleType.ELIMINATE_JOIN_BY_FK,
+            RuleType.ELIMINATE_JOIN_BY_UK,
+            RuleType.ELIMINATE_GROUP_BY_KEY_BY_UNIFORM
+    );
+    // The rules should be disabled when run MTMV task
+    public static final List<RuleType> DISABLE_RULES_WHEN_RUN_MTMV_TASK = 
ImmutableList.<RuleType>builder()
+            .addAll(DISABLE_RULES_WHEN_GENERATE_MTMV_CACHE)
+            .add(RuleType.ADD_DEFAULT_LIMIT).build();

Review Comment:
   beacause disable rules when is different between run mtmv task  and generate 
mtmv cache,so abstract 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]

Reply via email to