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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java:
##########
@@ -55,4 +58,79 @@ default Map<Slot, Expression> getAliasToProducer() {
                         )
                 );
     }
+
+    /**
+     * combine upper level and bottom level projections
+     * 1. alias combination, for example
+     * proj(x as y, b) --> proj(a as x, b, c) =>(a as y, b)
+     * 2. remove used projection in bottom project
+     * @param childProject bottom project
+     * @return project list for merged project
+     */
+    default List<NamedExpression> mergeProjections(Project childProject) {

Review Comment:
   nit: maybe a static function is better
   ```sql
   List<NamedExpression> mergeProjections(List<NamedExpression> top, 
List<NamedExpression> bottom)
   ```



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