You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "starocean999 (via GitHub)" <gi...@apache.org> on 2023/06/06 10:22:18 UTC

[GitHub] [doris] starocean999 opened a new pull request, #20508: [fix](nereids)filter and project node should be pushed down through cte

starocean999 opened a new pull request, #20508:
URL: https://github.com/apache/doris/pull/20508

   ## Proposed changes
   
   1.move PushdownFilterThroughCTEAnchor and PushdownProjectThroughCTEAnchor into PUSH_DOWN_FILTERS rule set
   2.move PushdownFilterThroughProject before MergeProjectPostProcessor
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morrySnow merged pull request #20508: [fix](nereids)filter and project node should be pushed down through cte

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow merged PR #20508:
URL: https://github.com/apache/doris/pull/20508


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morrySnow commented on a diff in pull request #20508: [fix](nereids)filter and project node should be pushed down through cte

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] starocean999 commented on pull request #20508: [fix](nereids)filter and project node should be pushed down through cte

Posted by "starocean999 (via GitHub)" <gi...@apache.org>.
starocean999 commented on PR #20508:
URL: https://github.com/apache/doris/pull/20508#issuecomment-1578370113

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] starocean999 commented on pull request #20508: [fix](nereids)filter and project node should be pushed down through cte

Posted by "starocean999 (via GitHub)" <gi...@apache.org>.
starocean999 commented on PR #20508:
URL: https://github.com/apache/doris/pull/20508#issuecomment-1578763327

   run buildall


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org