foxtail463 commented on code in PR #64032:
URL: https://github.com/apache/doris/pull/64032#discussion_r3433536535


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PruneOlapScanPartition.java:
##########
@@ -96,25 +95,17 @@ public List<Rule> buildRules() {
                         if (rewrittenLogicalRelation instanceof 
LogicalEmptyRelation) {
                             return rewrittenLogicalRelation;
                         }
-                        boolean skipPrunePredicate = 
ctx.connectContext.getSessionVariable().skipPrunePredicate
-                                || ctx.statementContext.isDelete();
-                        if (!skipPrunePredicate && 
prunedRes.second.isPresent()) {

Review Comment:
   `skipPrunePredicate` should only control whether the filter predicate is 
physically removed in the post processor.
   
   Even when predicate removal is skipped, the predicate may already have been 
applied by partition pruning and reflected in the selected partition row count. 
We still need to record it as an applied partition conjunct so 
`FilterEstimation` does not estimate the same partition predicate again.
   
   The actual predicate removal is still guarded in `PrunePartitionPredicate` 
by `context.shouldSkipPrunePredicate()`, so DELETE/session settings keep the 
original filter as before.



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