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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/ExtractAndNormalizeWindowExpression.java:
##########
@@ -61,7 +65,8 @@ public Rule build() {
             } else {
                 boolean needAggregate = bottomProjects.stream().anyMatch(expr 
->
                         expr.anyMatch(AggregateFunction.class::isInstance));
-                if (needAggregate) {
+                boolean hasAggChild = isProjectOnAggregate(project);
+                if (needAggregate & !hasAggChild) {

Review Comment:
   ```suggestion
                   if (needAggregate && !hasAggChild) {
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/ExtractAndNormalizeWindowExpression.java:
##########
@@ -61,7 +65,8 @@ public Rule build() {
             } else {
                 boolean needAggregate = bottomProjects.stream().anyMatch(expr 
->
                         expr.anyMatch(AggregateFunction.class::isInstance));
-                if (needAggregate) {
+                boolean hasAggChild = isProjectOnAggregate(project);

Review Comment:
   need some comment to explain why we need this



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

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


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

Reply via email to