pub enum Stage {
Local(LocalStage),
Remote(RemoteStage),
}Expand description
A unit of isolation for a portion of a physical execution plan
that can be executed independently and across a network boundary.
It implements ExecutionPlan and can be executed to produce a
stream of record batches.
If a stage has input stages, then those input stages will be executed on remote resources and will be provided the remainder of the stage tree.
For example, if our stage tree looks like this:
┌─────────┐
│ stage 1 │
└───┬─────┘
│
┌──────┴────────┐
┌────┴────┐ ┌────┴────┐
│ stage 2 │ │ stage 3 │
└────┬────┘ └─────────┘
│
┌──────┴────────┐
┌────┴────┐ ┌────┴────┐
│ stage 4 │ │ Stage 5 │
└─────────┘ └─────────┘
Then executing Stage 1 will run its plan locally. Stage 1 has two inputs, Stage 2 and Stage 3. We
know these will execute on remote resources. As such, the plan for Stage 1 must contain a
NetworkShuffleExec node that will read the results of Stage 2 and Stage 3 and coalesce the
results.
When Stage 1’s NetworkShuffleExec node is executed, it makes an ArrowFlightRequest to the
host assigned in the Stage. It provides the following Stage tree serialized in the body of the
Arrow Flight Ticket:
┌─────────┐
│ Stage 2 │
└────┬────┘
│
┌──────┴────────┐
┌────┴────┐ ┌────┴────┐
│ Stage 4 │ │ Stage 5 │
└─────────┘ └─────────┘
The receiving Worker will then execute Stage 2 and will repeat this process.
When Stage 4 is executed, it has no input tasks, so it is assumed that the plan included in that
Stage can complete on its own; it’s likely holding a leaf node in the overall physical plan and
producing data from a [DataSourceExec].
Variants§
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Stage
impl !UnwindSafe for Stage
impl Freeze for Stage
impl Send for Stage
impl Sync for Stage
impl Unpin for Stage
impl UnsafeUnpin for Stage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request