You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/15 10:08:20 UTC

[GitHub] [incubator-doris] yixiutt commented on a diff in pull request #9569: [vec](load) fix core of segment_writer while it is not thread-safe

yixiutt commented on code in PR #9569:
URL: https://github.com/apache/incubator-doris/pull/9569#discussion_r873143999


##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -98,29 +98,34 @@ Status BetaRowsetWriter::init(const RowsetWriterContext& rowset_writer_context)
 }
 
 Status BetaRowsetWriter::add_block(const vectorized::Block* block) {
-    if (block->rows() == 0) {
-        return Status::OK();
-    }
     if (UNLIKELY(_segment_writer == nullptr)) {
         RETURN_NOT_OK(_create_segment_writer(&_segment_writer));
     }
+    return _add_block(block, &_segment_writer);
+}
+
+Status BetaRowsetWriter::_add_block(const vectorized::Block* block,
+                                    std::unique_ptr<segment_v2::SegmentWriter>* segment_writer) {

Review Comment:
   add block will change segment_writer so i use unique_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.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org