zhannngchen commented on code in PR #17147: URL: https://github.com/apache/doris/pull/17147#discussion_r1118238160
########## be/src/olap/rowset/beta_rowset_writer.cpp: ########## @@ -759,15 +759,21 @@ void BetaRowsetWriter::_build_rowset_meta(std::shared_ptr<RowsetMeta> rowset_met int64_t total_data_size = 0; int64_t total_index_size = 0; std::vector<KeyBoundsPB> segments_encoded_key_bounds; + std::unordered_set<std::string> key_set; { std::lock_guard<std::mutex> lock(_segid_statistics_map_mutex); for (const auto& itr : _segid_statistics_map) { num_rows_written += itr.second.row_num; total_data_size += itr.second.data_size; total_index_size += itr.second.index_size; segments_encoded_key_bounds.push_back(itr.second.key_bounds); + if (_context.enable_unique_key_merge_on_write) { + DCHECK(itr.second.key_set.get() != nullptr); + key_set.insert(itr.second.key_set->begin(), itr.second.key_set->end()); Review Comment: values in `unordered_set` is const type, we can't use `std::move` to avoid data copy here, use `insert` directly. -- 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-unsubscr...@doris.apache.org 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