Skip to content

Commit 7070b36

Browse files
liuzqtcloud-fan
authored andcommitted
[MINOR][SQL] Rename shouldBroadcast to isDynamicPruning in InSubqueryExec
### What changes were proposed in this pull request? Rename `shouldBroadcast` param to `isDynamicPruning`. ### Why are the changes needed? Explicitly indicating the behavior mode of DPP ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? Closes apache#42286 from liuzqt/insubqueryexec-rename. Authored-by: Ziqi Liu <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
1 parent 2f9c8ac commit 7070b36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/PlanAdaptiveSubqueries.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ case class PlanAdaptiveSubqueries(
4545
)
4646
}
4747
val subquery = SubqueryExec(s"subquery#${exprId.id}", subqueryMap(exprId.id))
48-
InSubqueryExec(expr, subquery, exprId, shouldBroadcast = true)
48+
InSubqueryExec(expr, subquery, exprId, isDynamicPruning = false)
4949
case expressions.DynamicPruningSubquery(value, buildPlan,
5050
buildKeys, broadcastKeyIndex, onlyInBroadcast, exprId, _) =>
5151
val name = s"dynamicpruning#${exprId.id}"

sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ case class InSubqueryExec(
117117
child: Expression,
118118
plan: BaseSubqueryExec,
119119
exprId: ExprId,
120-
shouldBroadcast: Boolean = false,
120+
isDynamicPruning: Boolean = true,
121121
private var resultBroadcast: Broadcast[Array[Any]] = null,
122122
@transient private var result: Array[Any] = null)
123123
extends ExecSubqueryExpression with UnaryLike[Expression] with Predicate {
@@ -136,7 +136,7 @@ case class InSubqueryExec(
136136
} else {
137137
rows.map(_.get(0, child.dataType))
138138
}
139-
if (shouldBroadcast) {
139+
if (!isDynamicPruning) {
140140
resultBroadcast = plan.session.sparkContext.broadcast(result)
141141
}
142142
}
@@ -198,7 +198,7 @@ case class PlanSubqueries(sparkSession: SparkSession) extends Rule[SparkPlan] {
198198
}
199199
val executedPlan = QueryExecution.prepareExecutedPlan(sparkSession, query)
200200
InSubqueryExec(expr, SubqueryExec(s"subquery#${exprId.id}", executedPlan),
201-
exprId, shouldBroadcast = true)
201+
exprId, isDynamicPruning = false)
202202
}
203203
}
204204
}

0 commit comments

Comments
 (0)