Jackie-Jiang commented on a change in pull request #6991: URL: https://github.com/apache/incubator-pinot/pull/6991#discussion_r646820519
########## File path: pinot-core/src/main/java/org/apache/pinot/core/plan/AggregationGroupByOrderByPlanNode.java ########## @@ -58,6 +63,14 @@ public AggregationGroupByOrderByPlanNode(IndexSegment indexSegment, QueryContext List<ExpressionContext> groupByExpressions = queryContext.getGroupByExpressions(); assert groupByExpressions != null; _groupByExpressions = groupByExpressions.toArray(new ExpressionContext[0]); + _queryContext = queryContext; + + // Only trim if there is OrderBy and has a positive trim size + if (queryContext.getOrderByExpressions() != null && minSegmentTrimSize > 0) { Review comment: Because we have to do the actual comparison in the operator (during query run time), so imo more clear if we group the comparison in one place -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org