yiguolei commented on code in PR #69395:
URL: https://github.com/apache/doris/pull/69395#discussion_r4358900657
##########
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:
if (links_unmaterialized_hidden_column()) {
return false;
}
这个逻辑直接放在这吧,感觉底下不论是if 还是else 都调用这个逻辑了
--
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]