Jackie-Jiang commented on code in PR #18598:
URL: https://github.com/apache/pinot/pull/18598#discussion_r3314495140
##########
pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/rules/PinotAggregateExchangeNodeInsertRule.java:
##########
@@ -479,14 +479,25 @@ private static List<RexNode>
findImmediateProjects(RelNode relNode) {
return null;
}
- private static boolean isGroupTrimmingEnabled(RelOptRuleCall call,
Map<String, String> hintOptions) {
+ private static boolean isGroupTrimmingEnabled(RelOptRuleCall call,
Map<String, String> hintOptions,
+ Aggregate aggRel) {
if (hintOptions != null) {
String option =
hintOptions.get(PinotHintOptions.AggregateOptions.IS_ENABLE_GROUP_TRIM);
if (option != null) {
+ // Explicit hint always wins (true or false), for aggregates with AND
without aggregate functions.
return Boolean.parseBoolean(option);
}
}
+ // Group-by WITHOUT aggregate functions (DISTINCT or `GROUP BY col` with
no agg calls) can always push the
Review Comment:
I think we can push down the limit for the following scenarios:
- Distinct (no aggregates)
- Aggregates with order-by and order-by doesn't include aggregates
I don't follow why we cannot push down limit when there are multiple group
keys
--
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]