pub struct OrderingEquivalenceProperties { /* private fields */ }
Expand description
OrderingEquivalenceProperties
keeps track of columns that describe the
global ordering of the schema. These columns are not necessarily same; e.g.
┌-------┐
| a | b |
|---|---|
| 1 | 9 |
| 2 | 8 |
| 3 | 7 |
| 5 | 5 |
└---┴---┘
where both a ASC
and b DESC
can describe the table ordering. With
OrderingEquivalenceProperties
, we can keep track of these equivalences
and treat a ASC
and b DESC
as the same ordering requirement.
Implementations§
source§impl OrderingEquivalenceProperties
impl OrderingEquivalenceProperties
sourcepub fn extend(&mut self, other: Option<OrderingEquivalentClass>)
pub fn extend(&mut self, other: Option<OrderingEquivalentClass>)
Extends OrderingEquivalenceProperties
by adding ordering inside the other
to the self.oeq_class
.
pub fn oeq_class(&self) -> Option<&OrderingEquivalentClass>
sourcepub fn add_equal_conditions(
&mut self,
new_conditions: (&LexOrdering, &LexOrdering)
)
pub fn add_equal_conditions( &mut self, new_conditions: (&LexOrdering, &LexOrdering) )
Adds new equal conditions into the EquivalenceProperties. New equal conditions usually come from equality predicates in a join/filter.
sourcepub fn with_constants(self, constants: Vec<Arc<dyn PhysicalExpr>>) -> Self
pub fn with_constants(self, constants: Vec<Arc<dyn PhysicalExpr>>) -> Self
Add physical expression that have constant value to the self.constants
pub fn schema(&self) -> SchemaRef
sourcepub fn normalize_sort_requirements(
&self,
sort_reqs: &[PhysicalSortRequirement]
) -> Vec<PhysicalSortRequirement>
pub fn normalize_sort_requirements( &self, sort_reqs: &[PhysicalSortRequirement] ) -> Vec<PhysicalSortRequirement>
This function normalizes sort_reqs
by
- removing expressions that have constant value from requirement
- replacing sections that are in the
self.oeq_class.others
withself.oeq_class.head
- removing sections that satisfies global ordering that are in the post fix of requirement
sourcepub fn satisfies_leading_ordering(
&self,
leading_ordering: &PhysicalSortExpr
) -> bool
pub fn satisfies_leading_ordering( &self, leading_ordering: &PhysicalSortExpr ) -> bool
Checks whether leading_ordering
is contained in any of the ordering
equivalence classes.
Trait Implementations§
source§impl Clone for OrderingEquivalenceProperties
impl Clone for OrderingEquivalenceProperties
source§fn clone(&self) -> OrderingEquivalenceProperties
fn clone(&self) -> OrderingEquivalenceProperties
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more