Repository: StarRocks/starrocks
Pull request #57690: [BugFix] fix multi distinct agg function with same distinct col and group by one column with one Tablet property
Author: login: before-Sunrise
Labels: name: 3.3-merged
name: 3.3
name: 3.4
name: 3.4-merged
name: 3.5
name: 3.5-merged
Created: 2025-04-07T08:28:44Z | Merged: 2025-04-09T06:26:54Z

## Why I'm doing:
for sql like :
“select t1.k1, count(distinct k2)  , array_agg(distinct k2)
from db1.tbl1 t1 group by  k1“  ;
if tbl1 only has one tablet, it will genrate plan like below(since rewriteAggDistinctFirstStageFunction only address global agg with single distinct fncall), which cause result wrong
```
  RESULT SINK

  1:AGGREGATE (update finalize)
  |  output: count(DISTINCT 2: k2), array_agg(DISTINCT 2: k2)
  |  group by: 1: k1
  |  
  0:OlapScanNode
     TABLE: tbl1
```
## What I'm doing:
for multi distinct agg function with same distinct col and group by one column with one Tablet property, since splitAgg rule can not hanle it, use RewriteMultiDistinctRule instead

Fixes #issue

## What type of PR is this:

- [x] BugFix
- [ ] Feature
- [ ] Enhancement
- [ ] Refactor
- [ ] UT
- [ ] Doc
- [ ] Tool

Does this PR entail a change in behavior?

- [ ] Yes, this PR will result in a change in behavior.
- [x] No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

- [ ] Interface/UI changes: syntax, type conversion, expression evaluation, display information
- [ ] Parameter changes: default values, similar parameters but with different default values
- [ ] Policy changes: use new policy to replace old one, functionality automatically enabled
- [ ] Feature removed
- [ ] Miscellaneous: upgrade & downgrade compatibility, etc.

## Checklist:

- [x] I have added test cases for my bug fix or my new feature
- [ ] This pr needs user documentation (for new or modified features or behaviors)
- [ ] I have added documentation for my new feature or new function
- [ ] This is a backport pr

## Bugfix cherry-pick branch check:
- [x] I have checked the version labels which the pr will be auto-backported to the target branch
  - [x] 3.5
  - [x] 3.4
  - [x] 3.3
  - [ ] 3.2
  - [ ] 3.1



Diff:
diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/Utils.java b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/Utils.java
index ca6a8418f3bb2d..0f81cf22629972 100644
--- a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/Utils.java
+++ b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/Utils.java
@@ -773,8 +773,11 @@ public static boolean mustGenerateMultiStageAggregate(Operator inputOp, Operator
         return false;
     }
 
-    // without distinct function, the common distinctCols is an empty list.
-    public static Optional<List<ColumnRefOperator>> extractCommonDistinctCols(Collection<CallOperator> aggCallOperators) {
+    // 1. without distinct function, the common distinctCols is an empty list.
+    // 2. If has some distinct function, but distinct columns are not exactly same, ruturn Optional.empty
+    // 3. If has some distinct function and distinct columns are exactly same or only one distinct function, return Optional.of(distinctCols)
+    public static Optional<List<ColumnRefOperator>> extractCommonDistinctCols(
+            Collection<CallOperator> aggCallOperators) {
         Set<ColumnRefOperator> distinctChildren = Sets.newHashSet();
         for (CallOperator callOperator : aggCallOperators) {
             if (callOperator.isDistinct()) {
@@ -791,6 +794,28 @@ public static Optional<List<ColumnRefOperator>> extractCommonDistinctCols(Collec
         return Optional.of(Lists.newArrayList(distinctChildren));
     }
 
+    // like select array_agg(distinct LO_REVENUE), count(distinct LO_REVENUE) will return true
+    public static Boolean hasMultipleDistinctFuncShareSameDistinctColumns(Collection<CallOperator> aggCallOperators) {
+        List<CallOperator> distinctFuncs =
+                aggCallOperators.stream().filter(CallOperator::isDistinct).collect(Collectors.toList());
+        if (distinctFuncs.size() <= 1) {
+            return false;
+        }
+        Set<ColumnRefOperator> distinctChildren = Sets.newHashSet();
+        for (CallOperator callOperator : aggCallOperators) {
+            if (distinctChildren.isEmpty()) {
+                distinctChildren = Sets.newHashSet(callOperator.getColumnRefs());
+            } else {
+                Set<ColumnRefOperator> nextDistinctChildren = Sets.newHashSet(callOperator.getColumnRefs());
+                if (!SetUtils.isEqualSet(distinctChildren, nextDistinctChildren)) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
+    }
+
     public static boolean hasNonDeterministicFunc(ScalarOperator operator) {
         for (ScalarOperator child : operator.getChildren()) {
             if (child instanceof CallOperator) {
diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/transformation/RewriteMultiDistinctRule.java b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/transformation/RewriteMultiDistinctRule.java
index e3adf230c53772..7407f96954ef5a 100644
--- a/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/transformation/RewriteMultiDistinctRule.java
+++ b/fe/fe-core/src/main/java/com/starrocks/sql/optimizer/rule/transformation/RewriteMultiDistinctRule.java
@@ -22,11 +22,13 @@
 import com.starrocks.catalog.Function;
 import com.starrocks.catalog.FunctionSet;
 import com.starrocks.catalog.Type;
+import com.starrocks.common.FeConstants;
 import com.starrocks.sql.common.ErrorType;
 import com.starrocks.sql.common.StarRocksPlannerException;
 import com.starrocks.sql.optimizer.OptExpression;
 import com.starrocks.sql.optimizer.OptimizerContext;
 import com.starrocks.sql.optimizer.Utils;
+import com.starrocks.sql.optimizer.base.LogicalProperty;
 import com.starrocks.sql.optimizer.operator.OperatorType;
 import com.starrocks.sql.optimizer.operator.logical.LogicalAggregationOperator;
 import com.starrocks.sql.optimizer.operator.pattern.Pattern;
@@ -65,10 +67,22 @@ public boolean check(OptExpression input, OptimizerContext context) {
             return true;
         }
 
+        // if have multiple distinct functions and their distinct input cols are not exactly same
         Optional<List<ColumnRefOperator>> distinctCols = Utils.extractCommonDistinctCols(agg.getAggregations().values());
+        if (distinctCols.isEmpty()) {
+            return true;
+        }
+
+        // If have multiple distinct functions and their distinct input cols are exactly same, but split Agg rule can't handle it
+        // such as table has one tablet property
+        if (Utils.hasMultipleDistinctFuncShareSameDistinctColumns(agg.getAggregations().values()) &&
+                !Utils.couldGenerateMultiStageAggregate(input.getLogicalProperty(), input.getOp(),
+                        input.inputAt(0).getOp())) {
+            return true;
+        }
 
-        // all distinct function use the same distinct columns, we use the split rule to rewrite
-        return distinctCols.isEmpty();
+        // all distinct function use the same distinct columns and split rule can handle it, we use the split rule to rewrite
+        return false;
     }
 
     public List<OptExpression> transform(OptExpression input, OptimizerContext context) {
@@ -143,6 +157,12 @@ private boolean useCteToRewrite(OptExpression input, OptimizerContext context) {
             return true;
         }
 
+        // if one tablet, prefer to use MultiFun, which only has one global agg without exchange
+        LogicalProperty inputLogicalProperty = input.getLogicalProperty();
+        if (inputLogicalProperty.oneTabletProperty().supportOneTabletOpt && (!FeConstants.runningUnitTest)) {
+            return false;
+        }
+
         if (context.getSessionVariable().isCboCteReuse() &&
                 isCTEMoreEfficient(input, context, distinctAggOperatorList)) {
             return true;
diff --git a/fe/fe-core/src/test/java/com/starrocks/analysis/SelectStmtWithDecimalTypesNewPlannerTest.java b/fe/fe-core/src/test/java/com/starrocks/analysis/SelectStmtWithDecimalTypesNewPlannerTest.java
index 3f04d870069565..4ecc9a8155cb25 100644
--- a/fe/fe-core/src/test/java/com/starrocks/analysis/SelectStmtWithDecimalTypesNewPlannerTest.java
+++ b/fe/fe-core/src/test/java/com/starrocks/analysis/SelectStmtWithDecimalTypesNewPlannerTest.java
@@ -648,6 +648,7 @@ public void testSumDistinctWithRewriteMultiDistinctRuleTakeEffect() throws Excep
 
     @Test
     public void testSumDistinctWithRewriteMultiDistinctByCTERuleTakeEffect() throws Exception {
+        FeConstants.runningUnitTest = true;
         int oldStage = ctx.getSessionVariable().getNewPlannerAggStage();
         ctx.getSessionVariable().setNewPlanerAggStage(2);
         String sql = "select sum(distinct col_decimal32p9s2), sum(distinct col_decimal64p13s0), " +
@@ -663,6 +664,7 @@ public void testSumDistinctWithRewriteMultiDistinctByCTERuleTakeEffect() throws
         };
         Assert.assertTrue(Arrays.asList(expectSnippets).stream().allMatch(s -> plan.contains(s)));
         ctx.getSessionVariable().setNewPlanerAggStage(oldStage);
+        FeConstants.runningUnitTest = false;
     }
 
     @Test
diff --git a/fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java b/fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java
index 39d1ae9d3c0309..dfdb1583134dfd 100644
--- a/fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java
+++ b/fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java
@@ -1316,6 +1316,7 @@ public void testOnlyFullGroupBy() throws Exception {
 
     @Test
     public void testMultiCountDistinctWithNoneGroup() throws Exception {
+        FeConstants.runningUnitTest = true;
         String sql = "select count(distinct t1b), count(distinct t1c) from test_all_type";
         String plan = getFragmentPlan(sql);
         assertContains(plan, "  MultiCastDataSinks\n" +
@@ -1334,19 +1335,24 @@ public void testMultiCountDistinctWithNoneGroup() throws Exception {
         assertContains(plan, "  11:AGGREGATE (update serialize)\n" +
                 "  |  STREAMING\n" +
                 "  |  group by: 14: t1c");
+        FeConstants.runningUnitTest = false;
     }
 
     @Test
     public void testMultiCountDistinctWithNoneGroup1() throws Exception {
+        FeConstants.runningUnitTest = true;
         String sql = "with tmp1 as (select 'a' as a from dual), tmp2 as (select 'b' as b from dual) " +
                 "select count(distinct t1b), count(distinct t1c), count(distinct t1.a), count(distinct t2.b) " +
                 "from test_all_type join tmp1 t1 join tmp2 t2 join tmp1 t3 join tmp2 t4";
         Pair<String, ExecPlan> pair = UtFrameUtils.getPlanAndFragment(connectContext, sql);
+        System.out.println(pair.first);
         assertContains(pair.first, "CTEAnchor(cteid=3)");
+        FeConstants.runningUnitTest = false;
     }
 
     @Test
     public void testMultiCountDistinctWithNoneGroup2() throws Exception {
+        FeConstants.runningUnitTest = true;
         String sql = "select count(distinct t1b), count(distinct t1c), sum(t1c), max(t1b) from test_all_type";
         String plan = getFragmentPlan(sql);
         assertContains(plan, "MultiCastDataSinks\n" +
@@ -1372,23 +1378,28 @@ public void testMultiCountDistinctWithNoneGroup2() throws Exception {
                 "  |  \n" +
                 "  5:AGGREGATE (merge serialize)\n" +
                 "  |  group by: 15: t1b");
+        FeConstants.runningUnitTest = false;
     }
 
     @Test
     public void testMultiCountDistinctWithNoneGroup3() throws Exception {
+        FeConstants.runningUnitTest = true;
         String sql = "select count(distinct t1b), count(distinct t1c) from test_all_type";
         String plan = getFragmentPlan(sql);
         assertContains(plan, "18:NESTLOOP JOIN\n" +
                 "  |  join op: CROSS JOIN");
+        FeConstants.runningUnitTest = false;
     }
 
     @Test
     public void testMultiCountDistinctWithNoneGroup4() throws Exception {
+        FeConstants.runningUnitTest = true;
         String sql = "select count(distinct t1b + 1), count(distinct t1c + 2) from test_all_type";
         String plan = getFragmentPlan(sql);
         assertContains(plan, "1:Project\n" +
                 "  |  <slot 11> : CAST(2: t1b AS INT) + 1\n" +
                 "  |  <slot 12> : CAST(3: t1c AS BIGINT) + 2");
+        FeConstants.runningUnitTest = false;
     }
 
     @Test
@@ -2417,6 +2428,7 @@ public void testDistinctRewrite() throws Exception {
 
     @Test
     public void testMultiCountDistinctWithMoreGroupBy() throws Exception {
+        FeConstants.runningUnitTest = true;
         String sql = "select count(distinct t1c), count(distinct t1d), count(distinct t1e)" +
                 "from test_all_type group by t1a, t1b";
 
@@ -2428,6 +2440,7 @@ public void testMultiCountDistinctWithMoreGroupBy() throws Exception {
 
         plan = getFragmentPlan(sql);
         assertNotContains(plan, "multi_distinct_count");
+        FeConstants.runningUnitTest = false;
     }
 
     @Test
@@ -2935,12 +2948,14 @@ public void testRemoveGroupByConstant() throws Exception {
 
     @Test
     public void testMultiCountDistinctWithHavingLimit() throws Exception {
+        FeConstants.runningUnitTest = true;
         String sql = "select count(distinct t1b) as x, count(distinct t1c) as y from test_all_type having x = 2";
         String plan = getFragmentPlan(sql);
         assertContains(plan, "  8:AGGREGATE (merge finalize)\n" +
                 "  |  output: count(11: count)\n" +
                 "  |  group by: \n" +
                 "  |  having: 11: count = 2");
+        FeConstants.runningUnitTest = false;
 
         sql = "select count(distinct t1b) as x, count(distinct t1c) as y from test_all_type having x = 2 limit 10";
         plan = getFragmentPlan(sql);
@@ -2995,4 +3010,28 @@ public void testHavingAggregate() throws Exception {
                 "  |  group by: 2: v2, 3: v3\n" +
                 "  |  having: 2: v2 + 2 + 5: sum > 0");
     }
+
+    @Test
+    public void testOneTabletMultiDistinctFunctionHasSingleDistinctColAndOneGroupBy() throws Exception {
+        String sql = "select\n" +
+                "  t1.k1\n" +
+                "  , count(distinct k2) \n" +
+                "  , array_agg(distinct k2)\n" +
+                "from\n" +
+                "  db1.tbl1 t1\n" +
+                "group by\n" +
+                "  k1\n" +
+                "  ;";
+        String plan = getFragmentPlan(sql);
+        assertNotContains(plan, " 1:AGGREGATE (update finalize)\n" +
+                "  |  output: count(DISTINCT 2: k2), array_agg(DISTINCT 2: k2)\n" +
+                "  |  group by: 1: k1");
+
+        assertContains(plan, "1:AGGREGATE (update finalize)\n" +
+                "  |  output: multi_distinct_count(2: k2), array_agg_distinct(2: k2)\n" +
+                "  |  group by: 1: k1\n" +
+                "  |  \n" +
+                "  0:OlapScanNode\n" +
+                "     TABLE: tbl1");
+    }
 }


Reviews:
user: login: satanson
state: DISMISSED
author_association: CONTRIBUTOR
submitted_at: 2025-04-07T09:02:05Z
user: login: kangkaisen
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-07T09:02:12Z
user: login: LiShuMing
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-07T12:23:41Z
user: login: before-Sunrise
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-08T02:01:46Z
user: login: kangkaisen
state: DISMISSED
author_association: COLLABORATOR
submitted_at: 2025-04-08T02:55:25Z
user: login: satanson
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-08T09:34:30Z
user: login: stephen-shelby
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-09T06:26:46Z

Review comments:
diff_hunk: @@ -2995,4 +2995,21 @@ public void testHavingAggregate() throws Exception {
                 "  |  group by: 2: v2, 3: v3\n" +
                 "  |  having: 2: v2 + 2 + 5: sum > 0");
     }
+
+    @Test
+    public void testOneTabletMultiDistinctFunctionWithSingleDistinctColAndOneGroupby() throws Exception {
+        String sql = "select\n" +
+                "  t1.k1\n" +
+                "  , count(distinct k2) \n" +
+                "  , array_agg(distinct k2)\n" +
+                "from\n" +
+                "  db1.tbl1 t1\n" +
+                "group by\n" +
+                "  k1\n" +
+                "  ;";
+        String plan = getFragmentPlan(sql);
+        assertNotContains(plan, " 1:AGGREGATE (update finalize)\n" +
path: fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java
user: login: kangkaisen
body: please also check the right plan
created_at: 2025-04-07T09:02:12Z
author_association: COLLABORATOR
diff_hunk: @@ -2995,4 +2995,53 @@ public void testHavingAggregate() throws Exception {
                 "  |  group by: 2: v2, 3: v3\n" +
                 "  |  having: 2: v2 + 2 + 5: sum > 0");
     }
+
+    @Test
+    public void testOneTabletMultiDistinctFunctionHasSingleDistinctColAndOneGroupBy() throws Exception {
+        String sql = "select\n" +
+                "  t1.k1\n" +
+                "  , count(distinct k2) \n" +
+                "  , array_agg(distinct k2)\n" +
+                "from\n" +
+                "  db1.tbl1 t1\n" +
+                "group by\n" +
+                "  k1\n" +
+                "  ;";
+        String plan = getFragmentPlan(sql);
+        assertNotContains(plan, " 1:AGGREGATE (update finalize)\n" +
+                "  |  output: count(DISTINCT 2: k2), array_agg(DISTINCT 2: k2)\n" +
path: fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java
user: login: LiShuMing
body: This plan will generate a wrong result or a wrong plan which can not be executed in `be`? 
created_at: 2025-04-07T12:23:41Z
author_association: CONTRIBUTOR
diff_hunk: @@ -2995,4 +2995,53 @@ public void testHavingAggregate() throws Exception {
                 "  |  group by: 2: v2, 3: v3\n" +
                 "  |  having: 2: v2 + 2 + 5: sum > 0");
     }
+
+    @Test
+    public void testOneTabletMultiDistinctFunctionHasSingleDistinctColAndOneGroupBy() throws Exception {
+        String sql = "select\n" +
+                "  t1.k1\n" +
+                "  , count(distinct k2) \n" +
+                "  , array_agg(distinct k2)\n" +
+                "from\n" +
+                "  db1.tbl1 t1\n" +
+                "group by\n" +
+                "  k1\n" +
+                "  ;";
+        String plan = getFragmentPlan(sql);
+        assertNotContains(plan, " 1:AGGREGATE (update finalize)\n" +
+                "  |  output: count(DISTINCT 2: k2), array_agg(DISTINCT 2: k2)\n" +
path: fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java
user: login: before-Sunrise
body: > This plan will generate a wrong result or a wrong plan which can not be executed in `be`?

This plan will generate a wrong result or a wrong plan which can not be executed in `be`?
This is a single global Agg node directly on scan node, such plan won't do deduplication so result is wrong. For example, if k1 only has one value, and k2 has 9 elements with ndv is 2, this plan will return count(distinct k2) with 9 instead of 2
created_at: 2025-04-08T02:01:45Z
author_association: CONTRIBUTOR

PR comments:
user: login: sonarqubecloud[bot]
created_at: 2025-04-08T07:47:49Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=StarRocks_starrocks&pullRequest=57690) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [6 New issues](https://sonarcloud.io/project/issues?id=StarRocks_starrocks&pullRequest=57690&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=StarRocks_starrocks&pullRequest=57690&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=StarRocks_starrocks&pullRequest=57690&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=StarRocks_starrocks&pullRequest=57690&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=StarRocks_starrocks&pullRequest=57690&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=StarRocks_starrocks&pullRequest=57690)


author_association: NONE
user: login: github-actions[bot]
created_at: 2025-04-08T09:15:21Z
body: #### [Java-Extensions Incremental Coverage Report]


:white_check_mark: **pass** : 0 / 0 (0%)




author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-08T09:15:53Z
body: #### [FE Incremental Coverage Report]

:white_check_mark: **pass** : 23 / 23 (100.00%)




#### file detail

|   |path|covered_line|new_line|coverage|not_covered_line_detail|
|----|----|----|----|----|----|
|:large_blue_circle:|com/starrocks/sql/optimizer/Utils.java|13|13|100.00%|[]|
|:large_blue_circle:|com/starrocks/sql/optimizer/rule/transformation/RewriteMultiDistinctRule.java|10|10|100.00%|[]|




author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-08T09:16:11Z
body: #### [BE Incremental Coverage Report]


:white_check_mark: **pass** : 0 / 0 (0%)




author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-09T06:27:04Z
body: @Mergifyio backport branch-3.3
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-09T06:27:05Z
body: @Mergifyio backport branch-3.2
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-09T06:27:07Z
body: @Mergifyio backport branch-3.4
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-09T06:27:07Z
body: @Mergifyio backport branch-3.5
author_association: CONTRIBUTOR
user: login: mergify[bot]
created_at: 2025-04-09T06:27:18Z
body: > backport branch-3.3

#### ✅ Backports have been created

<details>

* [#57790 [BugFix] fix multi distinct agg function with same distinct col and group by one column with one Tablet property (backport #57690)](https://github.com/StarRocks/starrocks/pull/57790) has been created for branch `branch-3.3`

</details>


<!---
DO NOT EDIT
-*- Mergify Payload -*-
{"command": "backport branch-3.3", "conclusion": "success", "action_is_running": true}
-*- Mergify Payload End -*-
-->
author_association: CONTRIBUTOR
user: login: mergify[bot]
created_at: 2025-04-09T06:27:19Z
body: > backport branch-3.2

#### ✅ Backports have been created

<details>

* [#57791 [BugFix] fix multi distinct agg function with same distinct col and group by one column with one Tablet property (backport #57690)](https://github.com/StarRocks/starrocks/pull/57791) has been created for branch `branch-3.2` but encountered conflicts

</details>


<!---
DO NOT EDIT
-*- Mergify Payload -*-
{"command": "backport branch-3.2", "conclusion": "success", "action_is_running": true}
-*- Mergify Payload End -*-
-->
author_association: CONTRIBUTOR
user: login: mergify[bot]
created_at: 2025-04-09T06:27:21Z
body: > backport branch-3.4

#### ✅ Backports have been created

<details>

* [#57792 [BugFix] fix multi distinct agg function with same distinct col and group by one column with one Tablet property (backport #57690)](https://github.com/StarRocks/starrocks/pull/57792) has been created for branch `branch-3.4`

</details>


<!---
DO NOT EDIT
-*- Mergify Payload -*-
{"command": "backport branch-3.4", "conclusion": "success", "action_is_running": true}
-*- Mergify Payload End -*-
-->
author_association: CONTRIBUTOR
user: login: mergify[bot]
created_at: 2025-04-09T06:27:22Z
body: > backport branch-3.5

#### ✅ Backports have been created

<details>

* [#57793 [BugFix] fix multi distinct agg function with same distinct col and group by one column with one Tablet property (backport #57690)](https://github.com/StarRocks/starrocks/pull/57793) has been created for branch `branch-3.5`

</details>


<!---
DO NOT EDIT
-*- Mergify Payload -*-
{"command": "backport branch-3.5", "conclusion": "success", "action_is_running": true}
-*- Mergify Payload End -*-
-->
author_association: CONTRIBUTOR