From fcd69a9bd4e5a6eb30664da6f2b047f5447741c9 Mon Sep 17 00:00:00 2001 From: starocean999 <12095047@qq.com> Date: Tue, 14 May 2024 13:14:00 +0800 Subject: [PATCH] [fix](nereids)4 phase agg may lost parameter in some case --- .../doris/nereids/rules/implementation/AggregateStrategies.java | 2 +- regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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