xiaokang commented on code in PR #30145:
URL: https://github.com/apache/doris/pull/30145#discussion_r1497568811


##########
be/src/olap/rowset/beta_rowset.cpp:
##########
@@ -92,20 +92,17 @@ Status BetaRowset::do_load(bool /*use_cache*/) {
     return Status::OK();
 }
 
-Status BetaRowset::get_inverted_index_size_by_index_id(int64_t index_id, 
size_t* index_size) {
+Status BetaRowset::get_inverted_index_size(size_t* index_size) {
     auto fs = _rowset_meta->fs();
     if (!fs || _schema == nullptr) {
         return Status::Error<INIT_FAILED>("get fs failed");
     }
     for (int seg_id = 0; seg_id < num_segments(); ++seg_id) {
         auto seg_path = segment_file_path(seg_id);
         int64_t file_size = 0;
-        const auto* index = 
_schema->get_inverted_index_with_index_id(index_id, "");

Review Comment:
   Is V1 index file size not calculated?



##########
gensrc/proto/olap_file.proto:
##########
@@ -345,6 +350,7 @@ message TabletSchemaPB {
     optional bool enable_single_replica_compaction = 22 [default=false];
     optional bool skip_write_index_on_load = 23 [default=false];
     repeated int32 cluster_key_idxes = 24;
+    optional InvertedIndexStorageFormatPB inverted_index_storage_format = 25 
[default=V2];

Review Comment:
   consider add version in meta or in idx file header



##########
be/src/olap/rowset/segment_v2/segment.cpp:
##########
@@ -101,6 +102,9 @@ Segment::~Segment() {
 }
 
 Status Segment::_open() {
+    if (_tablet_schema->has_inverted_index()) {
+        RETURN_IF_ERROR(_open_inverted_index());

Review Comment:
   Lazy open may be necessary.



##########
be/src/olap/rowset/segment_v2/segment_writer.cpp:
##########
@@ -206,15 +214,17 @@ Status SegmentWriter::init(const std::vector<uint32_t>& 
col_ids, bool has_key) {
             skip_inverted_index = true;
         }
         // indexes for this column
-        opts.indexes = _tablet_schema->get_indexes_for_column(column);
+        opts.indexes = 
std::move(_tablet_schema->get_indexes_for_column_by_copy(column));

Review Comment:
   why copy needed here?



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