BiteTheDDDDt commented on code in PR #17192:
URL: https://github.com/apache/doris/pull/17192#discussion_r1120263298


##########
be/src/vec/core/block.cpp:
##########
@@ -177,15 +177,26 @@ void Block::erase(const std::set<size_t>& positions) {
     }
 }
 
-void Block::erase(size_t position) {
-    if (data.empty()) {
-        LOG(FATAL) << "Block is empty";
+void Block::erase_tail(size_t start) {
+    DCHECK(start <= data.size()) << fmt::format(
+            "Position out of bound in Block::erase(), max position = {}", 
data.size());
+    data.erase(data.begin() + start, data.end());
+    for (auto it = index_by_name.begin(); it != index_by_name.end();) {

Review Comment:
   better change it to index_by_name.erase(key) for each data erased



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