mrhhsg commented on code in PR #69395:
URL: https://github.com/apache/doris/pull/69395#discussion_r4359748876


##########
be/src/storage/compaction/compaction.cpp:
##########
@@ -753,6 +753,24 @@ bool CompactionMixin::handle_ordered_data_compaction() {
         }
     }
 
+    // A non-empty singleton stores placeholders for publish-time VERSION and 
TSO columns.
+    // Linking [2-2] and [3-3] into [2-3] would expose those placeholders 
rather than the
+    // synthesized values. Check only the rowsets actually linked: the tidy 
scan below can
+    // drop an unsafe tail [10-10] while retaining a safe range prefix [2-9].
+    auto links_unmaterialized_hidden_column = [this] {
+        return _input_rowsets.front()->start_version() != 
_input_rowsets.back()->end_version() &&
+               std::ranges::any_of(_input_rowsets, [](const RowsetSharedPtr& 
rowset) {
+                   const auto& schema = rowset->tablet_schema();
+                   return rowset->num_rows() > 0 &&
+                          rowset->start_version() == rowset->end_version() &&
+                          // A non-light-schema-change tablet can retain 
VERSION by name while
+                          // version_col_idx is -1; linking its singleton 
would expose stored 0.
+                          (schema->field_index(VERSION_COL) >= 0 ||
+                           schema->commit_tso_col_idx() >= 0 ||
+                           schema->changelog_tso_col_idx() >= 0);
+               });
+    };
+

Review Comment:
   调用之前有些判断,else 里面还有对 _input_rowsets 的 resize (810行)



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

Reply via email to