morrySnow commented on code in PR #45606:
URL: https://github.com/apache/doris/pull/45606#discussion_r1895532309


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/StructInfo.java:
##########
@@ -692,7 +702,7 @@ public Boolean visit(Plan plan, PlanCheckContext 
checkContext) {
                     || plan instanceof LogicalSort
                     || plan instanceof LogicalAggregate
                     || plan instanceof GroupPlan
-                    || plan instanceof LogicalRepeat) {
+                    || plan instanceof LogicalRepeat || 
isValidPushedNode(plan)) {

Review Comment:
   ```suggestion
                       || plan instanceof LogicalRepeat
                       || isValidPushedNode(plan)) {
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/StructInfo.java:
##########
@@ -653,6 +654,15 @@ public static PlanCheckContext of(Set<JoinType> 
supportJoinTypes) {
         }
     }
 
+    /**
+     * Limit, topN or partitionTopN which is pushed down doesn't participation 
in query rewritten by mv
+     * should be valid
+     */
+    public static boolean isValidPushedNode(Plan plan) {
+        return plan instanceof CouldPushed && ((CouldPushed) 
plan).needRemain() == true

Review Comment:
   ```suggestion
           return plan instanceof CouldPushed && ((CouldPushed) 
plan).needRemain()
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalLimit.java:
##########
@@ -169,4 +170,14 @@ public void computeEqualSet(DataTrait.Builder builder) {
     public void computeFd(DataTrait.Builder builder) {
         builder.addFuncDepsDG(child().getLogicalProperties().getTrait());
     }
+
+    @Override
+    public boolean needRemain() {
+        return true;
+    }
+
+    @Override
+    public boolean isPushed() {

Review Comment:
   all local limit is pushed? what will happen on top the original local limit?



-- 
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