pub struct EquivalenceClass { /* private fields */ }
Expand description
An EquivalenceClass
is a set of Arc<dyn PhysicalExpr>
s that are known
to have the same value for all tuples in a relation. These are generated by
equality predicates (e.g. a = b
), typically equi-join conditions and
equality conditions in filters.
Two EquivalenceClass
es are equal if they contains the same expressions in
without any ordering.
Implementations§
source§impl EquivalenceClass
impl EquivalenceClass
pub fn new(exprs: Vec<Arc<dyn PhysicalExpr>>) -> Self
sourcepub fn into_vec(self) -> Vec<Arc<dyn PhysicalExpr>>
pub fn into_vec(self) -> Vec<Arc<dyn PhysicalExpr>>
Return the inner vector of expressions
sourcepub fn push(&mut self, expr: Arc<dyn PhysicalExpr>)
pub fn push(&mut self, expr: Arc<dyn PhysicalExpr>)
Insert the expression into this class, meaning it is known to be equal to all other expressions in this class
sourcepub fn contains(&self, expr: &Arc<dyn PhysicalExpr>) -> bool
pub fn contains(&self, expr: &Arc<dyn PhysicalExpr>) -> bool
Returns true if this equivalence class contains t expression
sourcepub fn contains_any(&self, other: &Self) -> bool
pub fn contains_any(&self, other: &Self) -> bool
Returns true if this equivalence class has any entries in common with other
sourcepub fn iter(&self) -> impl Iterator<Item = &Arc<dyn PhysicalExpr>>
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn PhysicalExpr>>
Iterate over all elements in this class, in some arbitrary order
sourcepub fn with_offset(&self, offset: usize) -> Self
pub fn with_offset(&self, offset: usize) -> Self
Return a new equivalence class that have the specified offset added to each expression (used when schemas are appended such as in joins)
Trait Implementations§
source§impl Clone for EquivalenceClass
impl Clone for EquivalenceClass
source§fn clone(&self) -> EquivalenceClass
fn clone(&self) -> EquivalenceClass
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EquivalenceClass
impl Debug for EquivalenceClass
Auto Trait Implementations§
impl Freeze for EquivalenceClass
impl !RefUnwindSafe for EquivalenceClass
impl Send for EquivalenceClass
impl Sync for EquivalenceClass
impl Unpin for EquivalenceClass
impl !UnwindSafe for EquivalenceClass
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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