Skip to content

Commit

Permalink
normalize agg stats
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Aug 12, 2024
1 parent 6f649e7 commit be5e25d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1167,8 +1167,9 @@ private Statistics computeAggregate(Aggregate<? extends Plan> aggregate) {
builder.setDataSize(rowCount * outputExpression.getDataType().width());
slotToColumnStats.put(outputExpression.toSlot(), columnStat);
}
return new Statistics(rowCount, 1, slotToColumnStats);
// TODO: Update ColumnStats properly, add new mapping from output slot to ColumnStats
Statistics aggOutputStats = new Statistics(rowCount, 1, slotToColumnStats);
aggOutputStats.enforceValid();
return aggOutputStats;
}

private Statistics computeRepeat(Repeat<? extends Plan> repeat) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ public String toString() {
return Utils.toSqlString("PhysicalHashAggregate[" + id.asInt() + "]" + getGroupIdWithPrefix(),
"aggPhase", aggregateParam.aggPhase,
"aggMode", aggregateParam.aggMode,
"stats", statistics,
"maybeUseStreaming", maybeUsingStream,
"groupByExpr", groupByExpressions,
"outputExpr", outputExpressions,
"partitionExpr", partitionExpressions,
"requireProperties", requireProperties,
"topnOpt", topnPushInfo != null,
"stats", statistics
"topnOpt", topnPushInfo != null
);
}

Expand Down

0 comments on commit be5e25d

Please sign in to comment.