foxtail463 commented on code in PR #64032:
URL: https://github.com/apache/doris/pull/64032#discussion_r3433982170
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java:
##########
@@ -1295,16 +1282,46 @@ private ColumnStatistic getColumnStatistic(
}
/**
- * compute stats for catalogRelations except OlapScan
+ * compute stats for file scans with selected partition row count.
*/
+ public Statistics computeFileScan(LogicalFileScan fileScan) {
+ return buildFileScanStats(fileScan, fileScan.getTable(),
fileScan.getPartitionSelection());
+ }
Review Comment:
I think we should keep this behavior.
`isPruned() == false` does not always mean the partition predicate was not
applied. It can also mean the partition predicate was evaluated by the
partition pruner but matched all partitions, so the selected partition set is
the full table.
The marker means “these partition conjuncts have been accounted for by
partition pruning”, not necessarily “the row count was reduced”.
If we drop the applied conjunct marker here, `FilterEstimation` may estimate
the same partition predicate again and incorrectly reduce the row count.
--
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]