pub struct OrderingEquivalenceClass {
pub orderings: Vec<LexOrdering>,
}
Expand description
An OrderingEquivalenceClass
object keeps track of different alternative
orderings than can describe a schema. For example, consider the following table:
|a|b|c|d|
|1|4|3|1|
|2|3|3|2|
|3|1|2|2|
|3|2|1|3|
Here, both vec![a ASC, b ASC]
and vec![c DESC, d ASC]
describe the table
ordering. In this case, we say that these orderings are equivalent.
Fields§
§orderings: Vec<LexOrdering>
Implementations§
Source§impl OrderingEquivalenceClass
impl OrderingEquivalenceClass
Sourcepub fn new(orderings: Vec<LexOrdering>) -> Self
pub fn new(orderings: Vec<LexOrdering>) -> Self
Creates new ordering equivalence class from the given orderings.
Sourcepub fn contains(&self, ordering: &LexOrdering) -> bool
pub fn contains(&self, ordering: &LexOrdering) -> bool
Checks whether ordering
is a member of this equivalence class.
Sourcepub fn iter(&self) -> impl Iterator<Item = &LexOrdering>
pub fn iter(&self) -> impl Iterator<Item = &LexOrdering>
Returns an iterator over the equivalent orderings in this class.
Sourcepub fn extend(&mut self, other: Self)
pub fn extend(&mut self, other: Self)
Extend this ordering equivalence class with the other
class.
Sourcepub fn add_new_orderings(
&mut self,
orderings: impl IntoIterator<Item = LexOrdering>,
)
pub fn add_new_orderings( &mut self, orderings: impl IntoIterator<Item = LexOrdering>, )
Adds new orderings into this ordering equivalence class.
Sourcepub fn add_new_ordering(&mut self, ordering: LexOrdering)
pub fn add_new_ordering(&mut self, ordering: LexOrdering)
Adds a single ordering to the existing ordering equivalence class.
Sourcepub fn output_ordering(&self) -> Option<LexOrdering>
pub fn output_ordering(&self) -> Option<LexOrdering>
Returns the concatenation of all the orderings. This enables merge operations to preserve all equivalent orderings simultaneously.
pub fn join_suffix(self, other: &Self) -> Self
Sourcepub fn add_offset(&mut self, offset: usize)
pub fn add_offset(&mut self, offset: usize)
Adds offset
value to the index of each expression inside this
ordering equivalence class.
Sourcepub fn get_options(&self, expr: &Arc<dyn PhysicalExpr>) -> Option<SortOptions>
pub fn get_options(&self, expr: &Arc<dyn PhysicalExpr>) -> Option<SortOptions>
Gets sort options associated with this expression if it is a leading
ordering expression. Otherwise, returns None
.
Trait Implementations§
Source§impl Clone for OrderingEquivalenceClass
impl Clone for OrderingEquivalenceClass
Source§fn clone(&self) -> OrderingEquivalenceClass
fn clone(&self) -> OrderingEquivalenceClass
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OrderingEquivalenceClass
impl Debug for OrderingEquivalenceClass
Source§impl Default for OrderingEquivalenceClass
impl Default for OrderingEquivalenceClass
Source§fn default() -> OrderingEquivalenceClass
fn default() -> OrderingEquivalenceClass
Source§impl Display for OrderingEquivalenceClass
impl Display for OrderingEquivalenceClass
Source§impl Hash for OrderingEquivalenceClass
impl Hash for OrderingEquivalenceClass
Source§impl PartialEq for OrderingEquivalenceClass
impl PartialEq for OrderingEquivalenceClass
impl Eq for OrderingEquivalenceClass
impl StructuralPartialEq for OrderingEquivalenceClass
Auto Trait Implementations§
impl Freeze for OrderingEquivalenceClass
impl !RefUnwindSafe for OrderingEquivalenceClass
impl Send for OrderingEquivalenceClass
impl Sync for OrderingEquivalenceClass
impl Unpin for OrderingEquivalenceClass
impl !UnwindSafe for OrderingEquivalenceClass
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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