github-actions[bot] commented on code in PR #67941:
URL: https://github.com/apache/doris/pull/67941#discussion_r4003635622


##########
fe/fe-core/src/main/java/org/apache/doris/planner/SelectNode.java:
##########
@@ -69,9 +69,14 @@ public boolean isSerialNode() {
     public Pair<PlanNode, LocalExchangeType> enforceAndDeriveLocalExchange(
             PlanTranslatorContext translatorContext, PlanNode parent, 
LocalExchangeTypeRequire parentRequire) {
         Pair<PlanNode, LocalExchangeType> enforceResult
-                = enforceRequire(translatorContext, children.get(0), 0, 
parentRequire);
+                = enforceRequire(translatorContext, children.get(0), 0, 
LocalExchangeTypeRequire.noRequire());
         this.children = new ArrayList<>();
         this.children.add(enforceResult.first);
-        return Pair.of(this, enforceResult.second);
+        // Select does not own the parent's hash expressions, so it cannot 
prove that an
+        // independently derived child hash distribution uses the same keys. 
Report NOOP
+        // for a hash requirement and let the parent enforce its keys above 
Select.
+        LocalExchangeType outputType = 
parentRequire.preferType().isHashShuffle()

Review Comment:
   [P2] Avoid repartitioning an already aligned Select input. A reachable shape 
is `HashJoin(k) -> Select(r < 2) -> Project(k, random(0) AS r) -> Union`: the 
volatile alias keeps the Select above the projected Union, while the join's 
hash property on `k` is propagated to the Union branches. `SetOperationNode` 
can therefore report their agreed GLOBAL hash placement, but this line replaces 
that proven-aligned result with `NOOP`, so the join adds another GLOBAL local 
hash exchange above Select. For a low-selectivity predicate, the extra per-row 
hashing/routing, buffering, and pipeline boundary scale with the full input. 
Please retain the correctness fence for mismatched or unknown keys, but 
carry/compare enough hash-key identity to preserve aligned inputs, and add a 
plan-shape test covering both cases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to