You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "ankitsultana (via GitHub)" <gi...@apache.org> on 2025/06/25 23:37:33 UTC

Re: [PR] [multistage] Enable runInBroker / useBrokerPruning by Default + Misc. Improvements [pinot]

ankitsultana commented on code in PR #16204:
URL: https://github.com/apache/pinot/pull/16204#discussion_r2167810304


##########
pinot-query-planner/src/main/java/org/apache/pinot/calcite/rel/rules/PinotLogicalAggregateRule.java:
##########
@@ -177,13 +177,17 @@ private static PinotLogicalAggregate createPlan(Aggregate aggRel, @Nullable List
         leafReturnFinalResult, collations, limit);
   }
 
-  private static boolean isGroupTrimmingEnabled(RelOptRuleCall call, @Nullable Map<String, String> hintOptions) {
+  private static boolean isGroupTrimmingEnabled(RelOptRuleCall call, @Nullable Map<String, String> hintOptions,
+      Aggregate aggRel) {
     if (hintOptions != null) {
       String option = hintOptions.get(PinotHintOptions.AggregateOptions.IS_ENABLE_GROUP_TRIM);
       if (option != null) {
         return Boolean.parseBoolean(option);
       }
     }
+    if (aggRel.getAggCallList().isEmpty()) {

Review Comment:
   **Note for Reviewers:** For queries such as `WITH tmp AS (SELECT DISTINCT col1, col2 FROM tbl LIMIT 1000) SELECT ...`, at present we were not trimming groups by default which would have meant that the group-by could have grown really huge.
   
   For such queries, we can always leverage group-trimming, and this change enables that.



-- 
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-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org