airborne12 commented on code in PR #41625: URL: https://github.com/apache/doris/pull/41625#discussion_r1818842220
########## 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: consider index_id change situation -- 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