cloud-fan commented on code in PR #38497:
URL: https://github.com/apache/spark/pull/38497#discussion_r1019068317
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala:
##########
@@ -148,7 +150,7 @@ object RewritePredicateSubquery extends Rule[LogicalPlan]
with PredicateHelper {
// will have the final conditions in the LEFT ANTI as
// (A.A1 = B.B1 OR ISNULL(A.A1 = B.B1)) AND (B.B2 = A.A2) AND B.B3 >
1
val finalJoinCond = (nullAwareJoinConds ++
conditions).reduceLeft(And)
- Join(outerPlan, newSub, LeftAnti, Option(finalJoinCond),
JoinHint.NONE)
+ Join(outerPlan, newSub, LeftAnti, Option(finalJoinCond),
JoinHint(None, subHint))
Review Comment:
Shall we add comment here as well?
> Add subquery hint as right hint as the subquery plan is on the right side
of the join
Maybe add a method `def createJoinHint(subHint ...)`, so that we don't need
to duplicate the comment in many places: ``
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala:
##########
@@ -148,7 +150,7 @@ object RewritePredicateSubquery extends Rule[LogicalPlan]
with PredicateHelper {
// will have the final conditions in the LEFT ANTI as
// (A.A1 = B.B1 OR ISNULL(A.A1 = B.B1)) AND (B.B2 = A.A2) AND B.B3 >
1
val finalJoinCond = (nullAwareJoinConds ++
conditions).reduceLeft(And)
- Join(outerPlan, newSub, LeftAnti, Option(finalJoinCond),
JoinHint.NONE)
+ Join(outerPlan, newSub, LeftAnti, Option(finalJoinCond),
JoinHint(None, subHint))
Review Comment:
Shall we add comment here as well?
> Add subquery hint as right hint as the subquery plan is on the right side
of the join
Maybe add a method `def createJoinHint(subHint ...)`, so that we don't need
to duplicate the comment in many places.
--
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]