morningman commented on a change in pull request #5811:
URL: https://github.com/apache/incubator-doris/pull/5811#discussion_r648500560



##########
File path: be/src/olap/rowset/alpha_rowset_reader.cpp
##########
@@ -120,20 +129,24 @@ int64_t AlphaRowsetReader::filtered_rows() {
 }
 
 OLAPStatus AlphaRowsetReader::_union_block(RowBlock** block) {
-    while (_ordinal < _merge_ctxs.size()) {
+    while (_cur_ctx != nullptr) {
         // union block only use one block to store
-        OLAPStatus status = _pull_next_block(&(_merge_ctxs[_ordinal]));
+        OLAPStatus status = _pull_next_block(_cur_ctx);
         if (status == OLAP_ERR_DATA_EOF) {
-            _ordinal++;
-            continue;
+            delete _cur_ctx;
+            _cur_ctx = nullptr;
+            _sequential_ctxs.pop_front();
+            if (!_sequential_ctxs.empty()) {
+                _cur_ctx = *(_sequential_ctxs.begin());
+            }
         } else if (status != OLAP_SUCCESS) {
             return status;
         } else {
-            (*block) = _merge_ctxs[_ordinal].row_block;
+            (*block) = _cur_ctx->row_block;
             return OLAP_SUCCESS;
         }
     }
-    if (_ordinal == _merge_ctxs.size()) {
+    if (_sequential_ctxs.empty()) {

Review comment:
       OK

##########
File path: be/src/olap/rowset/alpha_rowset_reader.cpp
##########
@@ -37,6 +37,15 @@ AlphaRowsetReader::AlphaRowsetReader(int 
num_rows_per_row_block, AlphaRowsetShar
 AlphaRowsetReader::~AlphaRowsetReader() {
     delete _dst_cursor;
     _rowset->release();
+    while (!_merge_heap.empty()) {

Review comment:
       OK




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