yujun777 commented on code in PR #43107:
URL: https://github.com/apache/doris/pull/43107#discussion_r1835883293


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java:
##########
@@ -1196,6 +1196,75 @@ public Partition dropPartition(long dbId, String 
partitionName, boolean isForceD
         return dropPartition(dbId, partitionName, isForceDrop, !isForceDrop);
     }
 
+    public Partition dropPartitionForTruncate(long dbId, boolean isForceDrop,
+                                            RecyclePartitionParam 
recyclePartitionParam) {
+        // 1. If "isForceDrop" is false, the partition will be added to the 
Catalog Recyle bin, and all tablets of this
+        //    partition will not be deleted.
+        // 2. If "ifForceDrop" is true, the partition will be dropped 
immediately
+        Partition partition = recyclePartitionParam.partition;
+        if (partition != null) {
+            idToPartition.remove(partition.getId());

Review Comment:
   need add `nameToPartition.remove(partitionName)`,  just like  
OlapTable.dropPartition function.
   
   so refactor dropPartition and dropPartitionForTruncate to reuse code;



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