924060929 commented on code in PR #52133:
URL: https://github.com/apache/doris/pull/52133#discussion_r2163465011


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PruneEmptyPartition.java:
##########
@@ -37,7 +37,9 @@ public Rule build() {
             LogicalOlapScan scan = ctx.root;
             OlapTable table = scan.getTable();
             List<Long> partitionIdsToPrune = scan.getSelectedPartitionIds();
-            List<Long> ids = 
table.selectNonEmptyPartitionIds(partitionIdsToPrune);
+            // for transaction load, skip prune because there are invisible 
versions
+            List<Long> ids = (ConnectContext.get() != null && 
ConnectContext.get().isTxnModel()) ? partitionIdsToPrune
+                    : table.selectNonEmptyPartitionIds(partitionIdsToPrune);

Review Comment:
   how about
   ```java
   return logicalOlapScan().thenApply(ctx -> {
       // fast return for performance and never prune tablets for load for 
correctness
       if (ctx.isTxnModel()) {
           return ctx.root;
       }
       ...
   })
   ```



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