gortiz commented on code in PR #8979:
URL: https://github.com/apache/pinot/pull/8979#discussion_r982725932


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/blocks/results/SelectionResultsBlock.java:
##########
@@ -45,6 +56,26 @@ public Collection<Object[]> getRows() {
     return _rows;
   }
 
+  public SelectionResultsBlock cloneWithInnerPriorityQueue() {
+    if (_rows instanceof PriorityQueue) {
+      return new SelectionResultsBlock(_dataSchema, new 
PriorityQueue<>(_rows));

Review Comment:
   > The SelectionResultsBlock is still immutable. We just don't create a 
duplicate one when it is already backed by a priority queue.
   
   It is not. `MinMaxValueBasedSelectionOrderByCombineOperator` and 
`SelectionOrderByCombineOperator` will modify the returned instace (by directly 
modifying the value returned by `getRows()`.
   
   I think it is better to keep them immutable, but given that the mutable 
pattern seems to be used in other parts of Pinot, I'm going to add your 
suggested changes to do not generate another discussion that may delay this PR.



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

Reply via email to