ulysses-you commented on a change in pull request #34069:
URL: https://github.com/apache/spark/pull/34069#discussion_r713766244
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/LogicalQueryStageStrategy.scala
##########
@@ -35,21 +35,27 @@ import
org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, BroadcastNes
* stage in case of the larger join child relation finishes before the
smaller relation. Note
* that this rule needs to be applied before regular join strategies.
*/
-object LogicalQueryStageStrategy extends Strategy with PredicateHelper {
+object LogicalQueryStageStrategy extends Strategy with PredicateHelper with
JoinSelectionHelper {
private def isBroadcastStage(plan: LogicalPlan): Boolean = plan match {
case LogicalQueryStage(_, _: BroadcastQueryStageExec) => true
case _ => false
}
def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
- case ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, otherCondition, _,
+ case j @ ExtractEquiJoinKeys(joinType, leftKeys, rightKeys,
otherCondition, _,
left, right, hint)
if isBroadcastStage(left) || isBroadcastStage(right) =>
val buildSide = if (isBroadcastStage(left)) BuildLeft else BuildRight
- Seq(BroadcastHashJoinExec(
Review comment:
We would never get `BroadcastNestedLoopJoinExec` if the join is
`ExtractEquiJoinKeys ` before. And after this PR, the only way is hint.
--
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]