diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java index 72000f3ce5a7fea..776e4310f969a1e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java +++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java @@ -119,7 +119,8 @@ public void normalizeColumnStatistics(double inputRowCount, boolean isNumNullsDe // the following columnStatistic.isUnKnown() judgment is loop inside since current doris // supports partial stats deriving, i.e, allowing part of tables have stats and other parts don't, // or part of columns have stats but other parts don't, especially join and filter estimation. - if (!checkColumnStatsValid(columnStatistic, rowCount) && !columnStatistic.isUnKnown()) { + if ((!checkColumnStatsValid(columnStatistic, rowCount) && !columnStatistic.isUnKnown()) + || isNumNullsDecreaseByProportion && columnStatistic.numNulls != 0) { ColumnStatisticBuilder columnStatisticBuilder = new ColumnStatisticBuilder(columnStatistic); double ndv = Math.min(columnStatistic.ndv, rowCount); double numNulls = Math.min(columnStatistic.numNulls * factor, rowCount - ndv);