Expand description
EnforceDistribution optimizer rule inspects the physical plan with respect
to distribution requirements and adds RepartitionExec
s to satisfy them
when necessary. If increasing parallelism is beneficial (and also desirable
according to the configuration), this rule increases partition counts in
the physical plan.
Structs§
- Enforce
Distribution - The
EnforceDistribution
rule ensures that distribution requirements are met. In doing so, this rule will increase the parallelism in the plan by introducing repartitioning operators to the physical plan.
Functions§
- adjust_
input_ keys_ ordering - When the physical planner creates the Joins, the ordering of join keys is from the original query. That might not match with the output partitioning of the join node’s children A Top-Down process will use this method to adjust children’s output partitioning based on the parent key reordering requirements:
- ensure_
distribution - This function checks whether we need to add additional data exchange operators to satisfy distribution requirements. Since this function takes care of such requirements, we should avoid manually adding data exchange operators in other places.
- reorder_
aggregate_ keys - reorder_
join_ keys_ to_ inputs - When the physical planner creates the Joins, the ordering of join keys is from the original query. That might not match with the output partitioning of the join node’s children This method will try to change the ordering of the join keys to match with the partitioning of the join nodes’ children. If it can not match with both sides, it will try to match with one, either the left side or the right side.
- reorder_
partitioned_ join_ keys
Type Aliases§
- Distribution
Context - Keeps track of distribution changing operators (like
RepartitionExec
,SortPreservingMergeExec
,CoalescePartitionsExec
) and their ancestors. Using this information, we can optimize distribution of the plan if/when necessary. - Plan
With KeyRequirements - Keeps track of parent required key orderings.