morrySnow commented on code in PR #28607:
URL: https://github.com/apache/doris/pull/28607#discussion_r1430895111
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/NormalizeAggregate.java:
##########
@@ -100,22 +99,74 @@ public class NormalizeAggregate extends
OneRewriteRuleFactory implements Normali
@Override
public Rule build() {
return
logicalAggregate().whenNot(LogicalAggregate::isNormalized).then(aggregate -> {
+ // The LogicalAggregate node may contain window agg functions and
usual agg functions
+ // we call window agg functions as window-agg and usual agg
functions as trival-agg for short
+ // This rule simplify LogicalAggregate node by:
+ // 1. Push down some exprs from old LogicalAggregate node to a new
child LogicalProject Node,
+ // 2. create a new LogicalAggregate with normalized group by exprs
and trival-aggs
+ // 3. Pull up normalized old LogicalAggregate's output exprs to a
new parent LogicalProject Node
+ // Push down exprs:
+ // 1. all group by exprs
+ // 2. subquery expr in trival-agg
+ // 3. all input slots of trival-agg
Review Comment:
should include WindowExpression inner trival-agg
--
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]