Skip to content

Commit

Permalink
[VL] Fix for a corner case may break bhj + exchange validation (#3595)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer authored Nov 10, 2023
1 parent 047c993 commit 337b9d9
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,10 @@ case class AddTransformHintRule() extends Rule[SparkPlan] {

/** Inserts a transformable tag on top of those that are not supported. */
private def addTransformableTags(plan: SparkPlan): SparkPlan = {
addTransformableTag(plan)
plan.withNewChildren(plan.children.map(addTransformableTags))
// Walk the tree with post-order
val out = plan.withNewChildren(plan.children.map(addTransformableTags))
addTransformableTag(out)
out
}

private def addTransformableTag(plan: SparkPlan): Unit = {
Expand Down Expand Up @@ -551,7 +553,9 @@ case class AddTransformHintRule() extends Rule[SparkPlan] {
maybeExchange match {
case Some(exchange @ BroadcastExchangeExec(mode, child)) =>
TransformHints.tag(bhj, isBhjTransformable.toTransformHint)
TransformHints.tagNotTransformable(exchange, isBhjTransformable)
if (!isBhjTransformable.isValid) {
TransformHints.tagNotTransformable(exchange, isBhjTransformable)
}
case None =>
// we are in AQE, find the hidden exchange
// FIXME did we consider the case that AQE: OFF && Reuse: ON ?
Expand Down

0 comments on commit 337b9d9

Please sign in to comment.