Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Mar 26, 2024
1 parent 9d2700d commit 54f9e96
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,18 @@ private LogicalPlan normalizeAgg(LogicalAggregate<Plan> aggregate, Optional<Logi
// agg output include 2 parts
// pushedGroupByExprs and normalized agg functions

ImmutableList.Builder<NamedExpression> normalizedAggOutput
ImmutableList.Builder<NamedExpression> normalizedAggOutputBuilder
= ImmutableList.builderWithExpectedSize(groupingByExprs.size() + normalizedAggFuncs.size());
for (NamedExpression pushedGroupByExpr : pushedGroupByExprs) {
normalizedAggOutput.add(pushedGroupByExpr.toSlot());
normalizedAggOutputBuilder.add(pushedGroupByExpr.toSlot());
}
normalizedAggOutput.addAll(
normalizedAggOutputBuilder.addAll(
normalizedAggFuncsToSlotContext.pushDownToNamedExpression(normalizedAggFuncs)
);
// create new agg node
ImmutableList<NamedExpression> normalizedAggOutput = normalizedAggOutputBuilder.build();
LogicalAggregate<?> newAggregate =
aggregate.withNormalized(normalizedGroupExprs, normalizedAggOutput.build(), bottomPlan);
aggregate.withNormalized(normalizedGroupExprs, normalizedAggOutput, bottomPlan);

// create upper projects by normalize all output exprs in old LogicalAggregate
List<NamedExpression> upperProjects = normalizeOutput(aggregateOutput,
Expand Down

0 comments on commit 54f9e96

Please sign in to comment.