Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Repartition in datafusion::physical_optimizer::repartition - Rust
[go: Go Back, main page]

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§

Trait Implementations§

Returns the “default value” for a type. Read more
Rewrite plan to an optimized form
A human readable name for this optimizer rule
A flag to indicate whether the physical planner should valid the rule will not change the schema of the plan after the rewriting. Some of the optimization rules might change the nullable properties of the schema and should disable the schema check. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more