[SQL][minor] rename apply for QueryPlanner

A follow-up of https://github.com/apache/spark/pull/5624

Author: Wenchen Fan <cloud0fan@outlook.com>

Closes #6142 from cloud-fan/tmp and squashes the following commits:

971a92b [Wenchen Fan] use plan instead of execute
24c5ffe [Wenchen Fan] rename apply

(cherry picked from commit f2cd00be35)
Signed-off-by: Reynold Xin <rxin@databricks.com>
This commit is contained in:
Wenchen Fan 2015-05-14 10:25:18 -07:00 committed by Reynold Xin
parent 67ed0aa0fd
commit aa8a0f9637
2 changed files with 3 additions and 3 deletions

View file

@ -51,9 +51,9 @@ abstract class QueryPlanner[PhysicalPlan <: TreeNode[PhysicalPlan]] {
* filled in automatically by the QueryPlanner using the other execution strategies that are
* available.
*/
protected def planLater(plan: LogicalPlan) = apply(plan).next()
protected def planLater(plan: LogicalPlan) = this.plan(plan).next()
def apply(plan: LogicalPlan): Iterator[PhysicalPlan] = {
def plan(plan: LogicalPlan): Iterator[PhysicalPlan] = {
// Obviously a lot to do here still...
val iter = strategies.view.flatMap(_(plan)).toIterator
assert(iter.hasNext, s"No plan for $plan")

View file

@ -1321,7 +1321,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
// TODO: Don't just pick the first one...
lazy val sparkPlan: SparkPlan = {
SparkPlan.currentContext.set(self)
planner(optimizedPlan).next()
planner.plan(optimizedPlan).next()
}
// executedPlan should not be used to initialize any SparkPlan. It should be
// only used for execution.