pub struct EquivalentClass<T = Column> { /* private fields */ }
Expand description
EquivalentClass is a set of Column
s or PhysicalSortExpr
s that are known
to have the same value in all tuples in a relation. EquivalentClass<Column>
is generated by equality predicates, typically equijoin conditions and equality
conditions in filters. EquivalentClass<PhysicalSortExpr>
is generated by the
ROW_NUMBER
window function.
Implementations§
source§impl<T: Eq + Hash + Clone> EquivalentClass<T>
impl<T: Eq + Hash + Clone> EquivalentClass<T>
pub fn new(head: T, others: Vec<T>) -> EquivalentClass<T>
pub fn head(&self) -> &T
pub fn others(&self) -> &HashSet<T>
pub fn contains(&self, col: &T) -> bool
pub fn insert(&mut self, col: T) -> bool
pub fn remove(&mut self, col: &T) -> bool
pub fn iter(&self) -> impl Iterator<Item = &T>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
source§impl EquivalentClass<Vec<PhysicalSortExpr>>
impl EquivalentClass<Vec<PhysicalSortExpr>>
sourcepub fn add_offset(&self, offset: usize) -> Result<OrderingEquivalentClass>
pub fn add_offset(&self, offset: usize) -> Result<OrderingEquivalentClass>
Adds offset
value to the index of each expression inside self.head
and self.others
.
sourcepub fn normalize_with_equivalence_properties(
&self,
eq_properties: &EquivalenceProperties
) -> OrderingEquivalentClass
pub fn normalize_with_equivalence_properties( &self, eq_properties: &EquivalenceProperties ) -> OrderingEquivalentClass
This function normalizes OrderingEquivalenceProperties
according to eq_properties
.
More explicitly, it makes sure that expressions in oeq_class
are head entries
in eq_properties
, replacing any non-head entries with head entries if necessary.
sourcepub fn prefix_ordering_equivalent_class_with_existing_ordering(
&self,
existing_ordering: &[PhysicalSortExpr],
eq_properties: &EquivalenceProperties
) -> OrderingEquivalentClass
pub fn prefix_ordering_equivalent_class_with_existing_ordering( &self, existing_ordering: &[PhysicalSortExpr], eq_properties: &EquivalenceProperties ) -> OrderingEquivalentClass
Prefix with existing ordering.
Trait Implementations§
source§impl<T: Clone> Clone for EquivalentClass<T>
impl<T: Clone> Clone for EquivalentClass<T>
source§fn clone(&self) -> EquivalentClass<T>
fn clone(&self) -> EquivalentClass<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> RefUnwindSafe for EquivalentClass<T>where T: RefUnwindSafe,
impl<T> Send for EquivalentClass<T>where T: Send,
impl<T> Sync for EquivalentClass<T>where T: Sync,
impl<T> Unpin for EquivalentClass<T>where T: Unpin,
impl<T> UnwindSafe for EquivalentClass<T>where T: UnwindSafe,
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
Mutably borrows from an owned value. Read more