pub enum ExpressionPlacement {
Literal,
Column,
MoveTowardsLeafNodes,
KeepInPlace,
}Expand description
Describes where an expression should be placed in the query plan for optimal execution. This is used by optimizers to make decisions about expression placement, such as whether to push expressions down through projections.
Variants§
Literal
A constant literal value.
Column
A simple column reference.
MoveTowardsLeafNodes
A cheap expression that can be pushed to leaf nodes in the plan.
Examples include get_field for struct field access.
Pushing these expressions down in the plan can reduce data early
at low compute cost.
See ExpressionPlacement::should_push_to_leaves for details.
KeepInPlace
An expensive expression that should stay where it is in the plan. Examples include complex scalar functions or UDFs.
Implementations§
Source§impl ExpressionPlacement
impl ExpressionPlacement
Sourcepub fn should_push_to_leaves(&self) -> bool
pub fn should_push_to_leaves(&self) -> bool
Returns true if the expression can be pushed down to leaf nodes in the query plan.
This returns true for:
ExpressionPlacement::Column: Simple column references can be pushed down. They do no compute and do not increase or decrease the amount of data being processed. A projection that reduces the number of columns can eliminate unnecessary data early, but this method only considers one expression at a time, not a projection as a whole.ExpressionPlacement::MoveTowardsLeafNodes: Cheap expressions can be pushed down to leaves to take advantage of early computation and potential optimizations at the data source level. For examplestruct_col['field']is cheap to compute (just an Arc clone of the nested array for'field') and thus can reduce data early in the plan at very low compute cost. It may even be possible to eliminate the expression entirely if the data source can project only the needed field (as e.g. Parquet can).
Trait Implementations§
Source§impl Clone for ExpressionPlacement
impl Clone for ExpressionPlacement
Source§fn clone(&self) -> ExpressionPlacement
fn clone(&self) -> ExpressionPlacement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExpressionPlacement
impl Debug for ExpressionPlacement
Source§impl Hash for ExpressionPlacement
impl Hash for ExpressionPlacement
Source§impl PartialEq for ExpressionPlacement
impl PartialEq for ExpressionPlacement
impl Copy for ExpressionPlacement
impl Eq for ExpressionPlacement
impl StructuralPartialEq for ExpressionPlacement
Auto Trait Implementations§
impl Freeze for ExpressionPlacement
impl RefUnwindSafe for ExpressionPlacement
impl Send for ExpressionPlacement
impl Sync for ExpressionPlacement
impl Unpin for ExpressionPlacement
impl UnsafeUnpin for ExpressionPlacement
impl UnwindSafe for ExpressionPlacement
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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