This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 4189b9fe6f8 branch-3.0: [fix](nereids) Not use rule
FOUR_PHASE_AGGREGATE_WITH_DISTINCT_WITH_FULL_DISTRIBUTE when
mustUseMultiDistinctAgg #51099 (#51139)
4189b9fe6f8 is described below
commit 4189b9fe6f87c18516036290f2873a115803c19d
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jun 11 10:49:47 2025 +0800
branch-3.0: [fix](nereids) Not use rule
FOUR_PHASE_AGGREGATE_WITH_DISTINCT_WITH_FULL_DISTRIBUTE when
mustUseMultiDistinctAgg #51099 (#51139)
Cherry-picked from #51099
Co-authored-by: feiniaofeiafei <[email protected]>
---
.../nereids/rules/implementation/AggregateStrategies.java | 2 ++
regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy | 10 ++++++++++
2 files changed, 12 insertions(+)
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 3d25bce0b48..ecd951f1eb7 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
@@ -62,6 +62,7 @@ import org.apache.doris.nereids.trees.plans.AggMode;
import org.apache.doris.nereids.trees.plans.AggPhase;
import org.apache.doris.nereids.trees.plans.GroupPlan;
import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.algebra.Aggregate;
import org.apache.doris.nereids.trees.plans.algebra.Project;
import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
import org.apache.doris.nereids.trees.plans.logical.LogicalFileScan;
@@ -421,6 +422,7 @@ public class AggregateStrategies implements
ImplementationRuleFactory {
return couldConvertToMulti(agg);
})
.when(agg ->
agg.supportAggregatePhase(AggregatePhase.FOUR))
+ .whenNot(Aggregate::mustUseMultiDistinctAgg)
.thenApplyMulti(ctx -> {
Function<List<Expression>, RequireProperties>
secondPhaseRequireGroupByAndDistinctHash =
groupByAndDistinct -> RequireProperties.of(
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 ed69d0018c9..e2113ee7571 100644
--- a/regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy
+++ b/regression-test/suites/nereids_syntax_p0/agg_4_phase.groovy
@@ -85,4 +85,14 @@ suite("agg_4_phase") {
from agg_4_phase_tbl2
group by id
order by id"""
+
+ test {
+ sql """select
+
/*+SET_VAR(disable_nereids_rules='TWO_PHASE_AGGREGATE_SINGLE_DISTINCT_TO_MULTI')*/
+ id,group_concat(distinct field2 order by field1)
+ from agg_4_phase_tbl2
+ group by id
+ """
+ exception """lowestCostPlans with physicalProperties(GATHER) doesn't
exist in root group"""
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]