Kikyou1997 commented on code in PR #18118:
URL: https://github.com/apache/doris/pull/18118#discussion_r1148742863


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java:
##########
@@ -331,22 +317,41 @@ A not in (1, 2, 3, 100):
     }
 
     @Override
-    public Statistics visitNot(Not not, EstimationContext none) {
-        Preconditions.checkState(!(not.child() instanceof Not),
-                "Consecutive Not statement should be merged previously");
-        EstimationContext context = new EstimationContext(true, 
none.statistics);
-        return not.child().accept(this, context);
+    public Statistics visitNot(Not not, EstimationContext context) {
+        Statistics childStats = new FilterEstimation().estimate(not.child(), 
context.statistics);
+        double rowCount = Math.max(context.statistics.getRowCount() - 
childStats.getRowCount(), 0);
+        if (rowCount == 0.0) {
+            return Statistics.zero(context.statistics);

Review Comment:
   Why



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