imay commented on a change in pull request #1475: Fix bug when doing linked 
schema change.
URL: https://github.com/apache/incubator-doris/pull/1475#discussion_r303292495
 
 

 ##########
 File path: be/src/olap/rowset/alpha_rowset_writer.cpp
 ##########
 @@ -129,7 +129,28 @@ OLAPStatus AlphaRowsetWriter::add_rowset(RowsetSharedPtr 
rowset) {
                                                            
_rowset_writer_context.rowset_id));
         _cur_segment_group->set_empty(segment_group->empty());
         _cur_segment_group->set_num_segments(segment_group->num_segments());
-        
_cur_segment_group->add_zone_maps_for_linked_schema_change(segment_group->get_zone_maps());
+        _cur_segment_group->add_zone_maps(segment_group->get_zone_maps());
+        RETURN_NOT_OK(flush());
+        _num_rows_written += segment_group->num_rows();
+    }
+    return OLAP_SUCCESS;
+}
+
+OLAPStatus AlphaRowsetWriter::add_rowset_for_linked_schema_change(
+        RowsetSharedPtr rowset, const SchemaMapping& schema_mapping) {
+    _need_column_data_writer = false;
+    // this api is for LinkedSchemaChange
+    // use create hard link to copy rowset for performance
+    // this is feasible because LinkedSchemaChange is done on the same disk
+    AlphaRowsetSharedPtr alpha_rowset = 
std::dynamic_pointer_cast<AlphaRowset>(rowset);
+    for (auto& segment_group : alpha_rowset->_segment_groups) {
+        RETURN_NOT_OK(_init());
 
 Review comment:
   _init will be called many times

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to