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 1a22ebb93fde863a05ab18ea6952240b26c7a6fd
Author: 924060929 <[email protected]>
AuthorDate: Mon Jun 1 12:57:41 2026 +0800

    [fix](local shuffle) Intersect/Except: requireGlobalExecutionHash instead 
of autoRequireHash
    
    Same root cause as DORIS-26101: PARTITIONED Intersect/Except children
    enter via global hash exchange. The non-colocate branch used
    parentRequire.autoRequireHash() which fell back to RequireHash →
    LOCAL_EXECUTION_HASH_SHUFFLE. LOCAL hash modulus is incompatible with
    the global exchange on sibling children, causing missing rows.
    
    Fix: use requireGlobalExecutionHash() directly for non-colocate
    Intersect/Except, matching the HashJoinNode PARTITIONED fix.
    
    DORIS-26100: analytic → INTERSECT case now returns correct results.
---
 .../src/main/java/org/apache/doris/planner/SetOperationNode.java  | 8 +++++---
 .../org/apache/doris/planner/LocalShuffleNodeCoverageTest.java    | 7 ++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java
index 7d7008d5911..af9338fa74f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/SetOperationNode.java
@@ -228,9 +228,11 @@ public abstract class SetOperationNode extends PlanNode {
                 requireChild = LocalExchangeTypeRequire.requireBucketHash();
                 outputType = LocalExchangeType.BUCKET_HASH_SHUFFLE;
             } else {
-                requireChild = parentRequire.autoRequireHash();
-                outputType = AddLocalExchange.resolveExchangeType(
-                        requireChild, translatorContext, this, firstChild);
+                // PARTITIONED intersect/except: all children enter via global 
hash
+                // exchange. Require GLOBAL so any inserted exchange matches 
the
+                // cross-fragment instance mapping (same fix as HashJoinNode 
DORIS-26101).
+                requireChild = 
LocalExchangeTypeRequire.requireGlobalExecutionHash();
+                outputType = LocalExchangeType.GLOBAL_EXECUTION_HASH_SHUFFLE;
             }
         }
 
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java
index dbf9d1cda81..188941bdb3a 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java
@@ -426,9 +426,10 @@ public class LocalShuffleNodeCoverageTest {
         intersectNode.addChild(right);
         Pair<PlanNode, LocalExchangeType> intersectOutput = 
intersectNode.enforceAndDeriveLocalExchange(
                 ctx, null, LocalExchangeTypeRequire.requireHash());
-        
Assertions.assertEquals(LocalExchangeType.LOCAL_EXECUTION_HASH_SHUFFLE, 
intersectOutput.second);
-        assertChildLocalExchangeType(intersectNode, 0, 
LocalExchangeType.LOCAL_EXECUTION_HASH_SHUFFLE);
-        assertChildLocalExchangeType(intersectNode, 1, 
LocalExchangeType.LOCAL_EXECUTION_HASH_SHUFFLE);
+        // PARTITIONED intersect requires GLOBAL hash (DORIS-26100)
+        
Assertions.assertEquals(LocalExchangeType.GLOBAL_EXECUTION_HASH_SHUFFLE, 
intersectOutput.second);
+        assertChildLocalExchangeType(intersectNode, 0, 
LocalExchangeType.GLOBAL_EXECUTION_HASH_SHUFFLE);
+        assertChildLocalExchangeType(intersectNode, 1, 
LocalExchangeType.GLOBAL_EXECUTION_HASH_SHUFFLE);
 
         // Colocated ExceptNode with OlapScan children: OlapScan already 
provides BUCKET_HASH_SHUFFLE,
         // so requireBucketHash() is satisfied and no LocalExchangeNode is 
inserted.


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

Reply via email to