Struct datafusion::physical_optimizer::repartition::Repartition
source · pub struct Repartition {}
Expand description
Optimizer that introduces repartition to introduce more parallelism in the plan
For example, given an input such as:
┌─────────────────────────────────┐
│ │
│ ExecutionPlan │
│ │
└─────────────────────────────────┘
▲ ▲
│ │
┌─────┘ └─────┐
│ │
│ │
│ │
┌───────────┐ ┌───────────┐
│ │ │ │
│ batch A1 │ │ batch B1 │
│ │ │ │
├───────────┤ ├───────────┤
│ │ │ │
│ batch A2 │ │ batch B2 │
│ │ │ │
├───────────┤ ├───────────┤
│ │ │ │
│ batch A3 │ │ batch B3 │
│ │ │ │
└───────────┘ └───────────┘
Input Input
A B
This optimizer will attempt to add a RepartitionExec
to increase
the parallelism (to 3 in this case)
┌─────────────────────────────────┐
│ │
│ ExecutionPlan │
│ │
└─────────────────────────────────┘
▲ ▲ ▲ Input now has 3
│ │ │ partitions
┌───────┘ │ └───────┐
│ │ │
│ │ │
┌───────────┐ ┌───────────┐ ┌───────────┐
│ │ │ │ │ │
│ batch A1 │ │ batch A3 │ │ batch B3 │
│ │ │ │ │ │
├───────────┤ ├───────────┤ ├───────────┤
│ │ │ │ │ │
│ batch B2 │ │ batch B1 │ │ batch A2 │
│ │ │ │ │ │
└───────────┘ └───────────┘ └───────────┘
▲ ▲ ▲
│ │ │
└─────────┐ │ ┌──────────┘
│ │ │
│ │ │
┌─────────────────────────────────┐ batches are
│ RepartitionExec(3) │ repartitioned
│ RoundRobin │
│ │
└─────────────────────────────────┘
▲ ▲
│ │
┌─────┘ └─────┐
│ │
│ │
│ │
┌───────────┐ ┌───────────┐
│ │ │ │
│ batch A1 │ │ batch B1 │
│ │ │ │
├───────────┤ ├───────────┤
│ │ │ │
│ batch A2 │ │ batch B2 │
│ │ │ │
├───────────┤ ├───────────┤
│ │ │ │
│ batch A3 │ │ batch B3 │
│ │ │ │
└───────────┘ └───────────┘
Input Input
A B
Implementations
sourceimpl Repartition
impl Repartition
Trait Implementations
sourceimpl Default for Repartition
impl Default for Repartition
sourcefn default() -> Repartition
fn default() -> Repartition
Returns the “default value” for a type. Read more
sourceimpl PhysicalOptimizerRule for Repartition
impl PhysicalOptimizerRule for Repartition
sourcefn optimize(
&self,
plan: Arc<dyn ExecutionPlan>,
config: &SessionConfig
) -> Result<Arc<dyn ExecutionPlan>>
fn optimize(
&self,
plan: Arc<dyn ExecutionPlan>,
config: &SessionConfig
) -> Result<Arc<dyn ExecutionPlan>>
Rewrite
plan
to an optimized formAuto Trait Implementations
impl RefUnwindSafe for Repartition
impl Send for Repartition
impl Sync for Repartition
impl Unpin for Repartition
impl UnwindSafe for Repartition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more