songwdfu commented on code in PR #16277:
URL: https://github.com/apache/pinot/pull/16277#discussion_r2191434053
##########
pinot-core/src/main/java/org/apache/pinot/core/operator/query/GroupByOperator.java:
##########
@@ -138,8 +140,16 @@ protected GroupByResultsBlock getNextBlock() {
// TODO: Currently the groups are not trimmed if there is no ordering
specified. Consider ordering on group-by
// columns if no ordering is specified.
int minGroupTrimSize = _queryContext.getMinSegmentGroupTrimSize();
- if (_queryContext.getOrderByExpressions() != null && minGroupTrimSize > 0)
{
- int trimSize = GroupByUtils.getTableCapacity(_queryContext.getLimit(),
minGroupTrimSize);
+ int trimSize = -1;
+ List<OrderByExpressionContext> orderByExpressions =
_queryContext.getOrderByExpressions();
+ if (QueryContext.isSameOrderAndGroupByColumns(_queryContext) &&
_queryContext.getHavingFilter() == null) {
Review Comment:
> We can extract the segment level trim as a separate PR.
opened #16297
--
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]