Jackie-Jiang commented on code in PR #15095: URL: https://github.com/apache/pinot/pull/15095#discussion_r1964635431
########## pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/AggregateOperator.java: ########## @@ -108,33 +110,28 @@ public AggregateOperator(OpChainExecutionContext context, MultiStageOperator inp List<Integer> groupKeys = node.getGroupKeys(); - //process order trimming hint - int groupTrimSize = getGroupTrimSize(node.getNodeHint(), context.getOpChainMetadata()); - - if (groupTrimSize > -1) { - // limit is set to 0 if not pushed - int nodeLimit = node.getLimit() > 0 ? node.getLimit() : Integer.MAX_VALUE; - int limit = GroupByUtils.getTableCapacity(nodeLimit, groupTrimSize); - _groupTrimSize = limit; - if (limit == Integer.MAX_VALUE) { - // disable sorting because actual result can't realistically be bigger the limit - _priorityQueue = null; + int groupTrimSize = Integer.MAX_VALUE; + Comparator<Object[]> comparator = null; + int limit = node.getLimit(); + if (limit > 0) { + List<RelFieldCollation> collations = node.getCollations(); + if (collations.isEmpty()) { + groupTrimSize = limit; Review Comment: Also modified the code to allow disabling it by providing a non-positive MSE min trim size. -- 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-unsubscr...@pinot.apache.org 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