englefly commented on code in PR #63175:
URL: https://github.com/apache/doris/pull/63175#discussion_r3230521349


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -2042,15 +2046,18 @@ public void replayDropPartition(DropPartitionInfo info) 
throws MetaNotFoundExcep
         OlapTable olapTable = (OlapTable) 
db.getTableOrMetaException(info.getTableId(), TableType.OLAP);
         olapTable.writeLock();
         try {
+            Partition partition = null;
             if (info.isTempPartition()) {
                 olapTable.dropTempPartition(info.getPartitionName(), true);
             } else {
-                Partition partition = olapTable.dropPartition(info.getDbId(), 
info.getPartitionName(),
-                        info.isForceDrop());
+                partition = olapTable.dropPartition(info.getDbId(), 
info.getPartitionName(), info.isForceDrop());
                 if (!info.isForceDrop() && partition != null && 
info.getRecycleTime() != 0) {
                     
Env.getCurrentRecycleBin().setRecycleTimeByIdForReplay(partition.getId(), 
info.getRecycleTime());
                 }
             }
+            if (partition != null && !info.isTempPartition()) {

Review Comment:
   对temp partition的count(*) 不会被记录到缓存中,也不会被应用到 select count(*) from t; 上。
   
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/RewriteSimpleAggToConstantRule.java
 的tryRewrite() 函数里会检查是否有指定分区。如果指定分区就不rewrite



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