From 31d8fdd9e4e3345da3ace066892747f4e263cea3 Mon Sep 17 00:00:00 2001 From: morrySnow <101034200+morrySnow@users.noreply.github.com> Date: Thu, 3 Nov 2022 11:08:06 +0800 Subject: [PATCH] [fix](Nereids) finalize local aggregate should not turn on stream pre agg (#13922) --- .../rules/implementation/LogicalAggToPhysicalHashAgg.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalAggToPhysicalHashAgg.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalAggToPhysicalHashAgg.java index f6672aa7ee..46874ff526 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalAggToPhysicalHashAgg.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/LogicalAggToPhysicalHashAgg.java @@ -29,7 +29,8 @@ public class LogicalAggToPhysicalHashAgg extends OneImplementationRuleFactory { public Rule build() { return logicalAggregate().thenApply(ctx -> { boolean useStreamAgg = !ctx.connectContext.getSessionVariable().disableStreamPreaggregations - && !ctx.root.getGroupByExpressions().isEmpty(); + && !ctx.root.getGroupByExpressions().isEmpty() + && !ctx.root.isFinalPhase(); return new PhysicalAggregate<>( ctx.root.getGroupByExpressions(), ctx.root.getOutputExpressions(),