github-actions[bot] commented on code in PR #64601:
URL: https://github.com/apache/doris/pull/64601#discussion_r3426200089
##########
be/src/storage/tablet/tablet_reader.cpp:
##########
@@ -77,6 +79,42 @@ Status TabletReader::init(const ReaderParams& read_params) {
return res;
}
+void TabletReader::remove_delete_columns_from_access_paths(
+ const std::vector<RowsetMetaSharedPtr>& delete_predicates,
+ std::map<int32_t, TColumnAccessPaths>& all_access_paths) {
+ // all_access_paths is keyed by column unique id; a delete predicate
without one is
+ // resolved by name against the schema the delete was created with.
+ auto erase_by_predicate = [&](const DeletePredicatePB& delete_predicate,
+ const TabletSchema& delete_schema) {
+ auto erase_by_name = [&](const std::string& column_name) {
+ int32_t idx = delete_schema.field_index(column_name);
+ if (idx >= 0) {
+ all_access_paths.erase(delete_schema.column(idx).unique_id());
+ }
+ };
+ for (const auto& sub_pred : delete_predicate.sub_predicates_v2()) {
+ if (sub_pred.has_column_unique_id()) {
+ all_access_paths.erase(sub_pred.column_unique_id());
+ } else {
+ erase_by_name(sub_pred.column_name());
+ }
+ }
+ for (const auto& in_pred : delete_predicate.in_predicates()) {
+ if (in_pred.has_column_unique_id()) {
+ all_access_paths.erase(in_pred.column_unique_id());
+ } else {
+ erase_by_name(in_pred.column_name());
+ }
+ }
+ for (const auto& sub_predicate : delete_predicate.sub_predicates()) {
+
erase_by_name(DeleteHandler::parse_condition(sub_predicate).column_name);
Review Comment:
This helper no longer matches the delete predicate selection in
`DeleteHandler::init()`: the handler parses `sub_predicates_v2()` when it is
non-empty and only falls back to legacy `sub_predicates()` in the `else`
branch, but this loop parses the legacy strings unconditionally. Modern delete
rowsets can carry v1 strings only as compatibility payload alongside
authoritative v2 predicates, and `generate_delete_predicate()` even skips
validating that legacy string when `column_unique_id` is set. A rowset with
valid v2 metadata but a legacy string that `parse_condition()` rejects would
now throw during `TabletReader::init()`, even though the delete handler itself
would have evaluated it successfully from v2. Please gate this loop with `if
(delete_predicate.sub_predicates_v2().empty())` so the access-path stripping
follows the same contract as delete evaluation.
--
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]