xiangfu0 commented on code in PR #18817:
URL: https://github.com/apache/pinot/pull/18817#discussion_r3448389395


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/planner/physical/v2/opt/rules/AggregatePushdownRule.java:
##########
@@ -94,6 +98,33 @@ public PRelNode onMatch(PRelOptRuleCall call) {
       hintOptions = Map.of();
     }
     boolean isInputExchange = call._currentNode.unwrap().getInput(0) 
instanceof Exchange;
+    if (aggRel.getGroupType() != Aggregate.Group.SIMPLE) {

Review Comment:
   This new `GROUPING SETS` branch now returns 
`addPartialAggregateForGroupingSets(...)` before it checks 
`withinGroupCollation`, but the logical planner explicitly avoids leaf/final 
splitting when a `WITHIN GROUP` ordering is present. With 
`usePhysicalOptimizer=true`, a query like `LISTAGG(...) WITHIN GROUP (...)` 
under `ROLLUP`/`CUBE` can now be partially aggregated without preserving the 
required order, which is a silent wrong-result risk instead of the previous 
planner fallback. Can we keep the same `withinGroupCollation` escape hatch here 
and skip partial aggregation when ordered aggregates are involved?



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