From a588f8f48d168123f85fa2b74586f086db43ea84 Mon Sep 17 00:00:00 2001 From: englefly Date: Fri, 22 Sep 2023 19:36:32 +0800 Subject: [PATCH] fix --- .../apache/doris/nereids/stats/FilterEstimation.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java index 8ac74690e6daa5a..c6c0faea7dd27ab 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java @@ -393,11 +393,14 @@ public Statistics visitIsNull(IsNull isNull, EstimationContext context) { if (childStats.isUnKnown()) { return new StatisticsBuilder(context.statistics).build(); } - double outputRowCount = context.statistics.getRowCount() - childStats.numNulls; + double outputRowCount = childStats.numNulls; + ColumnStatisticBuilder colBuilder = new ColumnStatisticBuilder(childStats); + colBuilder.setCount(outputRowCount).setNumNulls(outputRowCount).setNdv(0) + .setMinValue(Double.NEGATIVE_INFINITY).setMaxValue(Double.POSITIVE_INFINITY); StatisticsBuilder builder = new StatisticsBuilder(context.statistics); - builder.putColumnStatistics(isNull.child(), childStats); - Statistics outputStats = builder.build().updateRowCountOnly(outputRowCount); - return outputStats; + builder.putColumnStatistics(isNull.child(), colBuilder.build()); + // TODO we do not call updateRowCountOnly() to make is-not-null work. this need refactor + return builder.build(); } static class EstimationContext {