github-actions[bot] commented on code in PR #67940:
URL: https://github.com/apache/doris/pull/67940#discussion_r4638027901
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/copier/LogicalPlanDeepCopier.java:
##########
@@ -328,10 +328,22 @@ public Plan visitLogicalJoin(LogicalJoin<? extends Plan,
? extends Plan> join, D
.deepCopy(join.getMarkJoinSlotReference().get(), context));
}
+ // The copy needs a hint of its own: the skew expression of the copy
reads the slots of the
+ // copy, so writing it into the hint of the original join leaves that
join with a skew
+ // expression which its children do not output. SaltJoin then skips
the branch of the
+ // original join at the output-membership check of its skew
expression, and the two branches
+ // would record one status together. The copy reports the rewrites of
its hint to the hint
+ // which it was copied from, so that the hint of the query reports
them as well (see
+ // DistributeHint.reportTheRewritesToTheHintWhichWasCopied): the
explain of the query prints
+ // the hints which the query wrote.
DistributeHint hint = join.getDistributeHint();
if (hint.getSkewInfo() != null) {
Expression skewExpr =
ExpressionDeepCopier.INSTANCE.deepCopy(hint.getSkewExpr(), context);
- hint.setSkewInfo(hint.getSkewInfo().withSkewExpr(skewExpr));
+ DistributeHint copiedHint = new DistributeHint(hint.distributeType,
Review Comment:
[P2] Propagate copied hint status back to the root hint. `visitLogicalJoin`
links each clone only to the hint it was copied from, while
`reportTheRewritesToTheHintWhichWasCopied()` updates only that immediate
predecessor. If a plan is copied twice (for example, a copied join is later
included in this rule's outer-plan copy), SaltJoin on H2 marks H2 and H1
successful but leaves the statement hint H0 UNUSED, so explain/status reporting
says the skew hint was unused even though the final plan was salted. Keep a
root-hint reference or recursively propagate the status/skew result, and add a
two-generation deep-copy test.
--
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]