diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java index e4e3170379dadd..5d00144f05c605 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java @@ -176,6 +176,9 @@ public void init(Analyzer analyzer) throws UserException { // to our input; our conjuncts don't get substituted because they already // refer to our output outputSmap = getCombinedChildSmap(); + if (aggInfo.isMerge()) { + aggInfo.substitute(aggInfo.getIntermediateSmap(), analyzer); + } aggInfo.substitute(outputSmap, analyzer); // assert consistent aggregate expr and slot materialization