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

Re: [PR] [fix](rbo) Keep the project that replaces output slots with literals [doris]

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/EliminateUnnecessaryProject.java:
##########
@@ -55,14 +57,56 @@ private Plan rewriteProject(LogicalProject<?> project) {
         if (project.child() instanceof LogicalEmptyRelation) {
             // eliminate unnecessary project
             return new LogicalEmptyRelation(StatementScopeIdGenerator.newRelationId(), project.getProjects());
-        } else if (project.getOutputExprIdBitSet().equals(project.getChildrenOutputExprIdBitSet())) {
+        } else if (isPassThroughProject(project)) {
             // eliminate unnecessary project
             return rewrite(project.child());
         } else {
             return rewriteChildren(project);
         }
     }
 
+    /**
+     * 判断 project 是否只是把孩子的输出原样透传(只有这种 project 才是多余的)。

Review Comment:
   用英文注释



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