diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java index edbd28677b4a00..e1095df7bab0b9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java @@ -1766,7 +1766,7 @@ private List> fourPhaseAggregateWithDistin AggregateFunction nonDistinct = aggregateFunction .withDistinctAndChildren(false, ImmutableList.copyOf(aggChild)); AggregateExpression nonDistinctAggExpr = new AggregateExpression(nonDistinct, - distinctLocalParam, aggregateFunction.child(0)); + distinctLocalParam, aggregateFunction); return nonDistinctAggExpr; } else { needUpdateSlot.add(aggregateFunction); diff --git a/regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy b/regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy index 4a3e60afb73e85..19cac99c153fa7 100644 --- a/regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy +++ b/regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy @@ -56,4 +56,6 @@ suite("agg_4_phase") { contains ":VAGGREGATE (update serialize)" } qt_4phase (test_sql) + + sql """select GROUP_CONCAT(distinct name, " ") from agg_4_phase_tbl;""" } \ No newline at end of file