yangzhg commented on a change in pull request #4242: URL: https://github.com/apache/incubator-doris/pull/4242#discussion_r464771921
########## File path: be/src/olap/rowset/segment_v2/segment_iterator.cpp ########## @@ -561,6 +561,29 @@ Status SegmentIterator::next_batch(RowBlockV2* block) { i += range_size; } } + + // phase 4: read delete index, fill in the row whether is delete. + { + std::shared_ptr<Roaring> current_bitmap(new Roaring()); + + // fetch delete index + const Roaring& delete_bitmap = _segment->delete_index_iterator().delete_bitmap(); + + const uint16_t* sv = block->selection_vector(); + const uint16_t sv_size = block->selected_size(); + uint16_t i = 0; + // check the delete rows and fill in the current_bitmap + // which use i in selection_vector as rowid + while (i < sv_size) { + + if(delete_bitmap.contains(_block_rowids[sv[i]])) { + current_bitmap->add(i); + } + i++; Review comment: why not put this code in set_delete_bitmap? it is not a good idea to pass shared_ptr ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org