Skip to content

Commit

Permalink
[VL] Fix for a corner case may break bhj + exchange validation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer committed Nov 2, 2023
1 parent 27defd8 commit d8b8f34
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 d8b8f34

Please sign in to comment.