yangzhg commented on a change in pull request #5313:
URL: https://github.com/apache/incubator-doris/pull/5313#discussion_r565988323



##########
File path: be/src/exec/topn_node.h
##########
@@ -101,12 +102,8 @@ class TopNNode : public ExecNode {
     // Number of rows skipped. Used for adhering to _offset.
     int64_t _num_rows_skipped;
 
-    // The priority queue will never have more elements in it than the LIMIT.  
The stl
-    // priority queue doesn't support a max size, so to get that 
functionality, the order
-    // of the queue is the opposite of what the ORDER BY clause specifies, 
such that the top
-    // of the queue is the last sorted element.
-    boost::scoped_ptr<std::priority_queue<Tuple*, std::vector<Tuple*>, 
TupleRowComparator>>
-            _priority_queue;
+    // The priority queue will never have more elements in it than the LIMIT.  
    
+    boost::scoped_ptr<SortingHeap<Tuple*, std::vector<Tuple*>, 
TupleRowComparator>> _priority_queue;

Review comment:
       ```suggestion
       std::unique_ptr<SortingHeap<Tuple*, std::vector<Tuple*>, 
TupleRowComparator>> _priority_queue;
   ```




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

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