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

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


The following commit(s) were added to refs/heads/fe_local_shuffle by this push:
     new d12245aa7fd [fix](local shuffle) Fix NLJ childUsePoolingScan: use 
useSerialSource without hasSerialScanNode gate
d12245aa7fd is described below

commit d12245aa7fdfe178724fa0f0eaa524ea57df59d1
Author: 924060929 <[email protected]>
AuthorDate: Tue Apr 14 23:19:12 2026 +0800

    [fix](local shuffle) Fix NLJ childUsePoolingScan: use useSerialSource 
without hasSerialScanNode gate
    
    The hasSerialScanNode() gate excluded fragments with serial Exchanges but no
    ScanNode (e.g., receive fragments with NLJ). In pooling mode these fragments
    still need BROADCAST on the build side — without it, probe tasks only see
    partial build data, causing row count mismatch in GROUPING SETS + subquery
    queries on 4+ BE clusters.
    
    Reverts the overly strict check introduced in the enforceRequire 
refactoring.
---
 .../main/java/org/apache/doris/planner/NestedLoopJoinNode.java    | 8 +++-----
 .../org/apache/doris/planner/LocalShuffleNodeCoverageTest.java    | 2 --
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java 
b/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
index d9395e7c9a4..49915ad5851 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/NestedLoopJoinNode.java
@@ -179,11 +179,9 @@ public class NestedLoopJoinNode extends JoinNodeBase {
     public Pair<PlanNode, LocalExchangeType> 
enforceAndDeriveLocalExchange(PlanTranslatorContext translatorContext,
             PlanNode parent, LocalExchangeTypeRequire parentRequire) {
 
-        // Pooling scan: useSerialSource() AND actually has a pooling scan 
node in the fragment.
-        // Without hasSerialScanNode(), useSerialSource() can be true for 
fragments with only
-        // serial Exchanges (use_serial_exchange=true) but no pooling scan, 
causing false positives.
-        boolean childUsePoolingScan = 
fragment.useSerialSource(translatorContext.getConnectContext())
-                && fragment.hasSerialScanNode();
+        // Pooling mode: the fragment uses serial source (pooling scan or 
serial exchange).
+        // NLJ build side needs BROADCAST in pooling mode so all probe tasks 
see full build data.
+        boolean childUsePoolingScan = 
fragment.useSerialSource(translatorContext.getConnectContext());
 
         LocalExchangeTypeRequire probeSideRequire;
         LocalExchangeTypeRequire buildSideRequire;
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 23f935091a9..8241f6d4c2a 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
@@ -310,8 +310,6 @@ public class LocalShuffleNodeCoverageTest {
                 Lists.newArrayList(new TupleId(NEXT_ID.getAndIncrement())), 
JoinOperator.INNER_JOIN, false);
         serialSourceJoin.fragment = Mockito.mock(PlanFragment.class);
         
Mockito.when(serialSourceJoin.fragment.useSerialSource(Mockito.any())).thenReturn(true);
-        // childUsePoolingScan requires BOTH useSerialSource AND 
hasSerialScanNode
-        
Mockito.when(serialSourceJoin.fragment.hasSerialScanNode()).thenReturn(true);
         Pair<PlanNode, LocalExchangeType> serialOutput = 
serialSourceJoin.enforceAndDeriveLocalExchange(
                 ctx, null, LocalExchangeTypeRequire.noRequire());
         Assertions.assertEquals(LocalExchangeType.ADAPTIVE_PASSTHROUGH, 
serialOutput.second);


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

Reply via email to