maryannxue commented on a change in pull request #23759: [SPARK-26840][SQL]
Avoid cost-based join reorder in presence of join hints
URL: https://github.com/apache/spark/pull/23759#discussion_r256045879
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/CostBasedJoinReorder.scala
##########
@@ -77,12 +77,12 @@ object CostBasedJoinReorder extends Rule[LogicalPlan] with
PredicateHelper {
*/
private def extractInnerJoins(plan: LogicalPlan): (Seq[LogicalPlan],
Set[Expression]) = {
plan match {
- case Join(left, right, _: InnerLike, Some(cond), _) =>
+ case Join(left, right, _: InnerLike, Some(cond), JoinHint.NONE) =>
val (leftPlans, leftConditions) = extractInnerJoins(left)
val (rightPlans, rightConditions) = extractInnerJoins(right)
(leftPlans ++ rightPlans, splitConjunctivePredicates(cond).toSet ++
leftConditions ++ rightConditions)
- case Project(projectList, j @ Join(_, _, _: InnerLike, Some(cond), _))
+ case Project(projectList, j @ Join(_, _, _: InnerLike, Some(cond),
JoinHint.NONE))
Review comment:
It would still be correct without this line of change, but I think it's more
efficient that way.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]