From eaeb84eea60464082a51104d1f46eaa191591516 Mon Sep 17 00:00:00 2001 From: 924060929 <924060929@qq.com> Date: Tue, 23 Apr 2024 18:58:16 +0800 Subject: [PATCH] 4 phase --- .../doris/nereids/properties/ChildrenPropertiesRegulator.java | 4 ++++ .../nereids/rules/implementation/AggregateStrategies.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java index 366730f7dc521e..f59867ffe6a849 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/properties/ChildrenPropertiesRegulator.java @@ -123,6 +123,10 @@ public Boolean visitPhysicalHashAggregate(PhysicalHashAggregate && agg.getOutputExpressions().size() == 1) { return true; } + if (agg.getGroupByExpressions().size() > 1 + && agg.getGroupByExpressions().size() == agg.getOutputExpressions().size()) { + return true; + } return false; } 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..c1f0e78487f063 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 @@ -300,7 +300,7 @@ && couldConvertToMulti(agg)) RuleType.FOUR_PHASE_AGGREGATE_WITH_DISTINCT.build( basePattern .when(agg -> agg.getDistinctArguments().size() == 1) - .when(agg -> agg.getGroupByExpressions().isEmpty()) + // .when(agg -> agg.getGroupByExpressions().isEmpty()) .thenApplyMulti(ctx -> fourPhaseAggregateWithDistinct(ctx.root, ctx.connectContext)) ) );