zzzxl1993 commented on code in PR #30145:
URL: https://github.com/apache/doris/pull/30145#discussion_r1500694960
##########
be/src/olap/compaction.cpp:
##########
@@ -530,20 +573,35 @@ Status CompactionMixin::do_inverted_index_compaction() {
};
for (auto&& column_uniq_id : ctx.skip_inverted_index) {
- auto index_id = _cur_tablet_schema->get_inverted_index(column_uniq_id,
"")->index_id();
+ auto col = _cur_tablet_schema->column_by_uid(column_uniq_id);
+ const auto* index_meta = _cur_tablet_schema->get_inverted_index(col);
+ std::vector<lucene::store::Directory*>
dest_index_dirs(dest_segment_num);
+ std::vector<lucene::store::Directory*> src_index_dirs(src_segment_num);
try {
- auto st = compact_column(index_id, src_segment_num,
dest_segment_num, src_index_files,
- dest_index_files, fs, index_writer_path,
tablet_path,
- trans_vec, dest_segment_num_rows);
+ for (int src_segment_id = 0; src_segment_id < src_segment_num;
src_segment_id++) {
+ auto src_dir =
+
DORIS_TRY(inverted_index_file_readers[src_segment_id]->open(index_meta));
+ src_index_dirs[src_segment_id] = std::move(src_dir.release());
+ }
+ for (int dest_segment_id = 0; dest_segment_id < dest_segment_num;
dest_segment_id++) {
+ auto dest_dir =
+
DORIS_TRY(inverted_index_file_writers[dest_segment_id]->open(index_meta));
+ dest_index_dirs[dest_segment_id] = dest_dir;
+ }
+ auto st = compact_column(index_meta->index_id(), src_index_dirs,
dest_index_dirs, fs,
Review Comment:
Is index compaction necessary for bkd indexes?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]