Skip to content

Commit

Permalink
[SPARK-31424][SQL] Rename AdaptiveSparkPlanHelper.collectInPlanAndSub…
Browse files Browse the repository at this point in the history
…queries to collectWithSubqueries

### What changes were proposed in this pull request?
Like #28092, this PR is to rename `QueryPlan.collectInPlanAndSubqueries` in AdaptiveSparkPlanHelper to `collectWithSubqueries`

### Why are the changes needed?
The old name is too verbose. `QueryPlan` is internal but it's the core of catalyst and we'd better make the API name clearer before we release it.

### Does this PR introduce any user-facing change?
no

### How was this patch tested?
N/A

Closes #28193 from gatorsmile/spark-31322.

Authored-by: gatorsmile <gatorsmile@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit ad79ae1)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
  • Loading branch information
gatorsmile authored and dongjoon-hyun committed Apr 12, 2020
1 parent 888b069 commit 36b0767
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -109,7 +109,7 @@ trait AdaptiveSparkPlanHelper {
* Returns a sequence containing the result of applying a partial function to all elements in this
* plan, also considering all the plans in its (nested) subqueries
*/
def collectInPlanAndSubqueries[B](p: SparkPlan)(f: PartialFunction[SparkPlan, B]): Seq[B] = {
def collectWithSubqueries[B](p: SparkPlan)(f: PartialFunction[SparkPlan, B]): Seq[B] = {
(p +: subqueriesAll(p)).flatMap(collect(_)(f))
}

Expand Down
Expand Up @@ -95,14 +95,14 @@ class AdaptiveQueryExecSuite
}

private def findReusedExchange(plan: SparkPlan): Seq[ReusedExchangeExec] = {
collectInPlanAndSubqueries(plan) {
collectWithSubqueries(plan) {
case ShuffleQueryStageExec(_, e: ReusedExchangeExec) => e
case BroadcastQueryStageExec(_, e: ReusedExchangeExec) => e
}
}

private def findReusedSubquery(plan: SparkPlan): Seq[ReusedSubqueryExec] = {
collectInPlanAndSubqueries(plan) {
collectWithSubqueries(plan) {
case e: ReusedSubqueryExec => e
}
}
Expand Down

0 comments on commit 36b0767

Please sign in to comment.