englefly commented on code in PR #23715:
URL: https://github.com/apache/doris/pull/23715#discussion_r1312619999
##########
fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java:
##########
@@ -131,6 +131,11 @@ public Statistics addColumnStats(Expression expression,
ColumnStatistic columnSt
return this;
}
+ public boolean containUnknownChildStats() {
+ return expressionToColumnStats.values().stream()
+ .allMatch(e -> e.isUnKnown);
Review Comment:
we should check the columnStatistics of the Not.child(), not all the columns
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java:
##########
@@ -348,8 +348,16 @@ A not in (1, 2, 3, 100):
return estimated;
}
+ // Right Now, we just assume the selectivity is 1 when stats is Unknown
+ private Statistics handleUnknownCase(EstimationContext context) {
+ return context.statistics;
+ }
+
@Override
public Statistics visitNot(Not not, EstimationContext context) {
+ if (context.statistics.containUnknownChildStats()) {
+ return handleUnknownCase(context);
Review Comment:
why we need a function, just return context.statistics
--
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]