val spark: SparkSession = ...
spark.sessionState.planner
SparkPlanner — Query Planner with no Hive Support
SparkPlanner
is a concrete Catalyst query planner that converts a logical plan to one or more physical plans using execution planning strategies with support for extra strategies (by means of ExperimentalMethods) and extraPlanningStrategies.
Note
|
SparkPlanner is expected to plan (aka generate) at least one physical plan for a logical plan.
|
SparkPlanner
is available as planner of a SessionState
.
SparkStrategy | Description |
---|---|
|
|
Extension point for extra planning strategies |
|
|
|
Note
|
SparkPlanner extends SparkStrategies abstract class.
|
Creating SparkPlanner Instance
SparkPlanner
takes the following when created:
Note
|
|
Extension Point for Extra Planning Strategies — extraPlanningStrategies
Method
extraPlanningStrategies: Seq[Strategy] = Nil
extraPlanningStrategies
is an extension point to register extra planning strategies with the query planner.
Note
|
extraPlanningStrategies are executed after extraStrategies.
|
Note
|
|
Collecting PlanLater Physical Operators — collectPlaceholders
Method
collectPlaceholders(plan: SparkPlan): Seq[(SparkPlan, LogicalPlan)]
collectPlaceholders
collects all PlanLater physical operators in the plan
physical plan.
Note
|
collectPlaceholders is a part of QueryPlanner Contract.
|
Pruning "Bad" Physical Plans — prunePlans
Method
prunePlans(plans: Iterator[SparkPlan]): Iterator[SparkPlan]
prunePlans
gives the input plans
physical plans back (i.e. with no changes).
Note
|
prunePlans is a part of QueryPlanner Contract to remove somehow "bad" plans.
|
pruneFilterProject
Method
Caution
|
FIXME |
Note
|
pruneFilterProject is a helper method used exclusively in InMemoryScans and HiveTableScans execution planning strategies.
|