Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Sep 22, 2023
1 parent dd8a304 commit a588f8f
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a588f8f

Please sign in to comment.