You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "walterddr (via GitHub)" <gi...@apache.org> on 2023/02/07 22:52:49 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #10241: [multistage] optimize limit without order by

walterddr commented on code in PR #10241:
URL: https://github.com/apache/pinot/pull/10241#discussion_r1099366991


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/SortOperator.java:
##########
@@ -137,8 +153,15 @@ private void consumeInputBlocks() {
         }
 
         List<Object[]> container = block.getContainer();
-        for (Object[] row : container) {
-          SelectionOperatorUtils.addToPriorityQueue(row, _rows, _numRowsToKeep);
+        if (_priorityQueue == null) {
+          // TODO: when push-down properly, we shouldn't get more than _numRowsToKeep
+          if (_rows.size() <= _numRowsToKeep) {
+            _rows.addAll(container);

Review Comment:
   yeah sounds good. i put the trimming at return block instead of insert but both are correct



-- 
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