pub struct OutputRequirements { /* private fields */ }
Expand description
This rule either adds or removes OutputRequirements
s to/from the physical
plan according to its mode
attribute, which is set by the constructors
new_add_mode
and new_remove_mode
. With this rule, we can keep track of
the global requirements (ordering and distribution) across rules.
The primary usecase of this node and rule is to specify and preserve the desired output ordering and distribution the entire plan. When sending to a single client, a single partition may be desirable, but when sending to a multi-partitioned writer, keeping multiple partitions may be better.
Implementations§
source§impl OutputRequirements
impl OutputRequirements
sourcepub fn new_add_mode() -> Self
pub fn new_add_mode() -> Self
Create a new rule which works in Add
mode; i.e. it simply adds a
top-level OutputRequirementExec
into the physical plan to keep track
of global ordering and distribution requirements if there are any.
Note that this rule should run at the beginning.
sourcepub fn new_remove_mode() -> Self
pub fn new_remove_mode() -> Self
Create a new rule which works in Remove
mode; i.e. it simply removes
the top-level OutputRequirementExec
from the physical plan if there is
any. We do this because a OutputRequirementExec
is an ancillary,
non-executable operator whose sole purpose is to track global
requirements during optimization. Therefore, a
OutputRequirementExec
should not appear in the final plan.
Trait Implementations§
source§impl Debug for OutputRequirements
impl Debug for OutputRequirements
source§impl PhysicalOptimizerRule for OutputRequirements
impl PhysicalOptimizerRule for OutputRequirements
source§fn optimize(
&self,
plan: Arc<dyn ExecutionPlan>,
_config: &ConfigOptions,
) -> Result<Arc<dyn ExecutionPlan>>
fn optimize( &self, plan: Arc<dyn ExecutionPlan>, _config: &ConfigOptions, ) -> Result<Arc<dyn ExecutionPlan>>
plan
to an optimized formsource§fn schema_check(&self) -> bool
fn schema_check(&self) -> bool
Auto Trait Implementations§
impl Freeze for OutputRequirements
impl RefUnwindSafe for OutputRequirements
impl Send for OutputRequirements
impl Sync for OutputRequirements
impl Unpin for OutputRequirements
impl UnwindSafe for OutputRequirements
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> 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 more