github-actions[bot] commented on code in PR #64787:
URL: https://github.com/apache/doris/pull/64787#discussion_r3466669206
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/NormalizeAggregate.java:
##########
@@ -182,7 +182,11 @@ public LogicalPlan normalizeAgg(LogicalAggregate<Plan>
aggregate, Optional<Logic
}
if (arg.containsType(SubqueryExpr.class,
WindowExpression.class, Unnest.class,
PreferPushDownProject.class)) {
- needPushDownSelfExprs.add(arg);
+ if (arg instanceof OrderExpression) {
+ needPushDownSelfExprs.add(arg.child(0));
Review Comment:
This still leaves the parallel distinct path with the old behavior. For
`group_concat(distinct k order by row_number() over(order by k))`, the distinct
branch below uses `arg instanceof OrderExpression ? arg.getInputSlots() : ...`,
so it only pushes slot `k` and never pushes the `WindowExpression` itself. For
`group_concat(distinct k order by (select 1), k)`, `getInputSlots()`
contributes nothing for the scalar subquery. The aggregate is then normalized
with the original `OrderExpression(window/subquery)` still in the aggregate
function; window extraction only runs on `LogicalProject`, and
`CheckAfterRewrite` later rejects window/subquery expressions left in this
position. Please mirror this unwrapping in the distinct branch as well and add
distinct ordered coverage for the window/subquery cases.
--
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]