package planning
Contains classes for enumerating possible physical plans for a given logical query plan.
- Alphabetic
- By Inheritance
- planning
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
class
GenericStrategy[PhysicalPlan <: TreeNode[PhysicalPlan]] extends Logging
Given a LogicalPlan, returns a list of
PhysicalPlans that can be used for execution.Given a LogicalPlan, returns a list of
PhysicalPlans that can be used for execution. If this strategy does not apply to the given logical operation then an empty list should be returned. - trait OperationHelper extends AliasHelper with PredicateHelper
-
abstract
class
QueryPlanner[PhysicalPlan <: TreeNode[PhysicalPlan]] extends AnyRef
Abstract class for transforming LogicalPlans into physical plans.
Abstract class for transforming LogicalPlans into physical plans. Child classes are responsible for specifying a list of GenericStrategy objects that each of which can return a list of possible physical plan options. If a given strategy is unable to plan all of the remaining operators in the tree, it can call planLater, which returns a placeholder object that will be collected and filled in using other available strategies.
TODO: RIGHT NOW ONLY ONE PLAN IS RETURNED EVER... PLAN SPACE EXPLORATION WILL BE IMPLEMENTED LATER.
- PhysicalPlan
The type of physical plan produced by this QueryPlanner
Value Members
-
object
ExtractEquiJoinKeys extends Logging with PredicateHelper
A pattern that finds joins with equality conditions that can be evaluated using equi-join.
A pattern that finds joins with equality conditions that can be evaluated using equi-join.
Null-safe equality will be transformed into equality as joining key (replace null with default value).
-
object
ExtractFiltersAndInnerJoins extends PredicateHelper
A pattern that collects the filter and inner joins.
A pattern that collects the filter and inner joins.
Filter | inner Join / \ ----> (Seq(plan0, plan1, plan2), conditions) Filter plan2 | inner join / \ plan0 plan1
Note: This pattern currently only works for left-deep trees.
- object ExtractSingleColumnNullAwareAntiJoin extends JoinSelectionHelper with PredicateHelper
-
object
GroupBasedRowLevelOperation
An extractor for row-level commands such as DELETE, UPDATE, MERGE that were rewritten using plans that operate on groups of rows.
An extractor for row-level commands such as DELETE, UPDATE, MERGE that were rewritten using plans that operate on groups of rows.
This class extracts the following entities:
- the group-based rewrite plan;
- the condition that defines matching groups;
- the read relation that can be either DataSourceV2Relation or DataSourceV2ScanRelation depending on whether the planning has already happened;
- object NodeWithOnlyDeterministicProjectAndFilter
-
object
PhysicalAggregation
An extractor used when planning the physical execution of an aggregation.
An extractor used when planning the physical execution of an aggregation. Compared with a logical aggregation, the following transformations are performed:
- Unnamed grouping expressions are named so that they can be referred to across phases of aggregation
- Aggregations that appear multiple times are deduplicated.
- The computation of the aggregations themselves is separated from the final result. For
example, the
countincount + 1will be split into an AggregateExpression and a final computation that computescount.resultAttribute + 1.
-
object
PhysicalOperation extends OperationHelper
A pattern that matches any number of project or filter operations even if they are non-deterministic, as long as they satisfy the requirement of CollapseProject and CombineFilters.
A pattern that matches any number of project or filter operations even if they are non-deterministic, as long as they satisfy the requirement of CollapseProject and CombineFilters. All filter operators are collected and their conditions are broken up and returned together with the top project operator. Aliases are in-lined/substituted if necessary.
-
object
PhysicalWindow
An extractor used when planning physical execution of a window.
An extractor used when planning physical execution of a window. This extractor outputs the window function type of the logical window.
The input logical window must contain same type of window functions, which is ensured by the rule ExtractWindowExpressions in the analyzer.
-
object
ScanOperation extends OperationHelper
A variant of PhysicalOperation which can match multiple Filters that are not combinable due to non-deterministic predicates.
A variant of PhysicalOperation which can match multiple Filters that are not combinable due to non-deterministic predicates. This is useful for scan operations as we need to match a bunch of adjacent Projects/Filters to apply column pruning, even if the Filters can't be combined, such as
Project(a, Filter(rand() > 0.5, Filter(rand() < 0.8, TableScan))), which we should only read columnafrom the relation.