Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix
  • Loading branch information
gatorsmile committed Apr 12, 2020
commit d8a7c68cc0b929eba07abce448364032c3c438ef
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,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