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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/PushdownFilterThroughCTEAnchor.java:
##########
@@ -31,10 +31,10 @@ public class PushdownFilterThroughCTEAnchor extends 
OneRewriteRuleFactory {
 
     @Override
     public Rule build() {
-        return logicalFilter(logicalCTEAnchor()).thenApply(ctx -> {
-            LogicalFilter<LogicalCTEAnchor<Plan, Plan>> filter = ctx.root;
-            LogicalCTEAnchor<Plan, Plan> anchor = filter.child();
-            return anchor.withChildren(anchor.left(), 
filter.withChildren((Plan) anchor.right()));
+        return logicalFilter(logicalCTE()).thenApply(ctx -> {
+            LogicalFilter<LogicalCTE<Plan>> filter = ctx.root;
+            LogicalCTE<Plan> anchor = filter.child();
+            return anchor.withChildren(filter.withChildren(anchor.child()));
         }).toRule(RuleType.PUSHDOWN_FILTER_THROUGH_CTE_ANCHOR);

Review Comment:
   ```suggestion
           }).toRule(RuleType.PUSHDOWN_FILTER_THROUGH_CTE);
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleSet.java:
##########
@@ -129,7 +130,8 @@ public class RuleSet {
             new MergeFilters(),
             new MergeGenerates(),
             new MergeLimits(),
-            new PushdownFilterThroughCTEAnchor());
+            new PushdownFilterThroughCTEAnchor(),
+            new PushdownProjectThroughCTEAnchor());

Review Comment:
   ```suggestion
               new PushdownFilterThroughCTE(),
               new PushdownProjectThroughCTE());
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/PushdownProjectThroughCTEAnchor.java:
##########
@@ -31,10 +31,10 @@ public class PushdownProjectThroughCTEAnchor extends 
OneRewriteRuleFactory {
 
     @Override
     public Rule build() {
-        return logicalProject(logicalCTEAnchor()).thenApply(ctx -> {
-            LogicalProject<LogicalCTEAnchor<Plan, Plan>> project = ctx.root;
-            LogicalCTEAnchor<Plan, Plan> anchor = project.child();
-            return anchor.withChildren(anchor.child(0), 
project.withChildren(anchor.child(1)));
+        return logicalProject(logicalCTE()).thenApply(ctx -> {
+            LogicalProject<LogicalCTE<Plan>> project = ctx.root;
+            LogicalCTE<Plan> anchor = project.child();
+            return anchor.withChildren(project.withChildren(anchor.child()));
         }).toRule(RuleType.PUSH_DOWN_PROJECT_THROUGH_CTE_ANCHOR);

Review Comment:
   ```suggestion
           }).toRule(RuleType.PUSH_DOWN_PROJECT_THROUGH_CTE);
   ```



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