This is an automated email from the ASF dual-hosted git repository.

924060929 pushed a commit to branch fe_local_shuffle_rebase
in repository https://gitbox.apache.org/repos/asf/doris.git

commit d9d613c55bda81d6942426e41a3a88bc08c53a1a
Author: 924060929 <[email protected]>
AuthorDate: Wed May 27 09:34:15 2026 +0800

    [fix](local shuffle) RepeatNode: stop forwarding hash require below repeat
    
    The rollup REPEAT is not distribution-preserving (it NULLs grouping columns 
per
    set and produces GROUPING_ID, which the downstream agg hashes on but which 
does
    not exist below the repeat). Forwarding the parent HASH require down pushed 
the
    local exchange before the 8x row expansion and hashed by the child's single
    upstream shuffle key instead of the agg's grouping_exprs, collapsing rows 
onto
    one instance (tpcds q67: +73%, 65s -> 113s).
    
    Recurse with noRequire so the parent inserts its hash local exchange above 
the
    repeat using its own grouping_exprs, mirroring BE whose RepeatOperatorX 
returns
    a NOOP required_data_distribution.
---
 .../src/main/java/org/apache/doris/planner/RepeatNode.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/RepeatNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/RepeatNode.java
index bf1be174f97..e20e813142b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/RepeatNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/RepeatNode.java
@@ -101,8 +101,17 @@ public class RepeatNode extends PlanNode {
     @Override
     public Pair<PlanNode, LocalExchangeType> enforceAndDeriveLocalExchange(
             PlanTranslatorContext translatorContext, PlanNode parent, 
LocalExchangeTypeRequire parentRequire) {
+        // REPEAT (rollup/grouping sets) is NOT distribution-preserving: it 
NULLs grouping
+        // columns per set and produces GROUPING_ID, which is part of the 
downstream agg hash
+        // key but does not exist below the repeat. Forwarding the parent HASH 
require down
+        // would push the local exchange before the row expansion AND hash by 
the child
+        // distribution (a single upstream shuffle key) instead of the agg 
grouping_exprs,
+        // collapsing rows onto one instance (tpcds q67, +73%). Recurse with 
noRequire so the
+        // parent inserts its hash local exchange ABOVE the repeat using its 
own grouping_exprs
+        // (mirrors BE, whose RepeatOperatorX has a NOOP 
required_data_distribution).
         Pair<PlanNode, LocalExchangeType> enforceResult
-                = enforceRequire(translatorContext, children.get(0), 0, 
parentRequire);
+                = enforceRequire(translatorContext, children.get(0), 0,
+                        LocalExchangeTypeRequire.noRequire());
         children = new java.util.ArrayList<>();
         children.add(enforceResult.first);
         return Pair.of(this, enforceResult.second);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to