csun5285 commented on code in PR #41625:
URL: https://github.com/apache/doris/pull/41625#discussion_r1819971529


##########
be/src/olap/compaction.cpp:
##########
@@ -795,6 +696,33 @@ void 
Compaction::construct_index_compaction_columns(RowsetWriterContext& ctx) {
         if 
(!field_is_slice_type(_cur_tablet_schema->column_by_uid(col_unique_id).type())) 
{
             continue;
         }
+
+        // if index properties are different, index compaction maybe needs to 
be skipped.
+        bool is_continue = false;
+        std::optional<std::map<std::string, std::string>> first_properties;
+        for (const auto& rowset : _input_rowsets) {
+            const auto* tablet_index =
+                    rowset->tablet_schema()->get_inverted_index(col_unique_id, 
"");
+            // no inverted index
+            if (tablet_index == nullptr) {
+                ctx.columns_to_do_index_compaction.insert(col_unique_id);
+                is_continue = true;
+                break;
+            }
+            const auto& properties = tablet_index->properties();
+            if (!first_properties.has_value()) {
+                first_properties = properties;
+            } else {
+                if (properties != first_properties.value()) {
+                    ctx.columns_to_do_index_compaction.insert(col_unique_id);
+                    is_continue = true;
+                    break;
+                }

Review Comment:
   done



##########
be/src/olap/rowset/beta_rowset_writer.cpp:
##########
@@ -189,13 +189,63 @@ Result<std::vector<size_t>> 
SegmentFileCollection::segments_file_size(int seg_id
     return ResultError(st);
 }
 
+InvertedIndexFileCollection::~InvertedIndexFileCollection() = default;
+
+Status InvertedIndexFileCollection::add(int seg_id, 
InvertedIndexFileWriterPtr&& index_writer) {
+    std::lock_guard lock(_lock);
+
+    _inverted_index_file_writers.emplace(seg_id, std::move(index_writer));

Review Comment:
   done



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

Reply via email to