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


##########
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:
   should we add only `_numRowsToKeep  - _rows.size()` number of rows vs all of 
container ?



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

Reply via email to