yiguolei commented on code in PR #66472:
URL: https://github.com/apache/doris/pull/66472#discussion_r3747501419


##########
be/src/storage/delete/delete_handler.cpp:
##########
@@ -535,45 +535,80 @@ Status DeleteHandler::_parse_column_pred(TabletSchemaSPtr 
complete_schema,
                 col_unique_id = sub_predicate.column_unique_id();
             }
         }
-        if (col_unique_id < 0) {
-            const auto& column =
-                    
*DORIS_TRY(delete_pred_related_schema->column(condition.column_name));
-            col_unique_id = column.unique_id();
-        }
-        condition.col_unique_id = col_unique_id;
-        const auto& column = complete_schema->column_by_uid(col_unique_id);
-        uint32_t index = complete_schema->field_index(col_unique_id);
+        ColumnId column_id;
+        RETURN_IF_ERROR(_resolve_column(read_schema, col_unique_id, 
condition.column_name,
+                                        delete_pred_related_schema, 
&column_id));
+        const auto& column = *read_schema.column(column_id);
+        condition.col_unique_id = column.unique_id();
         std::shared_ptr<ColumnPredicate> predicate;
-        RETURN_IF_ERROR(parse_to_predicate(index, column.name(), 
column.get_vec_type(), condition,
-                                           _predicate_arena, predicate));
+        RETURN_IF_ERROR(parse_to_predicate(column_id, column.name(), 
column.get_vec_type(),
+                                           condition, _predicate_arena, 
predicate));
         if (predicate != nullptr) {
             delete_conditions->column_predicate_vec.push_back(predicate);
         }
     }
     return Status::OK();
 }
 
-Status DeleteHandler::init(TabletSchemaSPtr tablet_schema,
+Status DeleteHandler::_resolve_column(ReadSchema& read_schema, int32_t 
col_unique_id,
+                                      const std::string& column_name,
+                                      const TabletSchemaSPtr& 
delete_pred_related_schema,
+                                      ColumnId* column_id) {
+    // A valid UID is the complete identity. A dropped column and a later

Review Comment:
   这块代码,我们需要特殊补齐一下beut。 可能regression test 覆盖不到。
   需要覆盖doris 2.0 之前的delete condition 里没有column unique id的情况。
   需要覆盖,比如 table  columna, columnb; 然后delete where  columna = 1, 然后再drop 
columna, 再add new columna,再drop columna 这种例子。 
   需要想办法把delete handler的覆盖率弄到100%



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