pub struct ExprOrdering {
    pub expr: Arc<dyn PhysicalExpr>,
    pub state: Option<SortProperties>,
    pub children_states: Option<Vec<SortProperties>>,
}
Expand description

The ExprOrdering struct is designed to aid in the determination of ordering (represented by SortProperties) for a given PhysicalExpr. When analyzing the orderings of a PhysicalExpr, the process begins by assigning the ordering of its leaf nodes. By propagating these leaf node orderings upwards in the expression tree, the overall ordering of the entire PhysicalExpr can be derived.

This struct holds the necessary state information for each expression in the PhysicalExpr. It encapsulates the orderings (state) associated with the expression (expr), and orderings of the children expressions (children_states). The ExprOrdering of a parent expression is determined based on the ExprOrdering states of its children expressions.

Fields§

§expr: Arc<dyn PhysicalExpr>§state: Option<SortProperties>§children_states: Option<Vec<SortProperties>>

Implementations§

source§

impl ExprOrdering

source

pub fn new(expr: Arc<dyn PhysicalExpr>) -> Self

source

pub fn children(&self) -> Vec<ExprOrdering>

source

pub fn new_with_children( children_states: Vec<SortProperties>, parent_expr: Arc<dyn PhysicalExpr> ) -> Self

Trait Implementations§

source§

impl Debug for ExprOrdering

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl TreeNode for ExprOrdering

source§

fn apply_children<F>(&self, op: &mut F) -> Result<VisitRecursion>where F: FnMut(&Self) -> Result<VisitRecursion>,

Apply the closure F to the node’s children
source§

fn map_children<F>(self, transform: F) -> Result<Self>where F: FnMut(Self) -> Result<Self>,

Apply transform F to the node’s children, the transform F might have a direction(Preorder or Postorder)
source§

fn apply<F>(&self, op: &mut F) -> Result<VisitRecursion, DataFusionError>where F: FnMut(&Self) -> Result<VisitRecursion, DataFusionError>,

Use preorder to iterate the node on the tree so that we can stop fast for some cases. Read more
source§

fn visit<V>(&self, visitor: &mut V) -> Result<VisitRecursion, DataFusionError>where V: TreeNodeVisitor<N = Self>,

Visit the tree node using the given TreeNodeVisitor It performs a depth first walk of an node and its children. Read more
source§

fn transform<F>(self, op: &F) -> Result<Self, DataFusionError>where F: Fn(Self) -> Result<Transformed<Self>, DataFusionError>,

Convenience utils for writing optimizers rule: recursively apply the given op to the node tree. When op does not apply to a given node, it is left unchanged. The default tree traversal direction is transform_up(Postorder Traversal).
source§

fn transform_down<F>(self, op: &F) -> Result<Self, DataFusionError>where F: Fn(Self) -> Result<Transformed<Self>, DataFusionError>,

Convenience utils for writing optimizers rule: recursively apply the given ‘op’ to the node and all of its children(Preorder Traversal). When the op does not apply to a given node, it is left unchanged.
source§

fn transform_up<F>(self, op: &F) -> Result<Self, DataFusionError>where F: Fn(Self) -> Result<Transformed<Self>, DataFusionError>,

Convenience utils for writing optimizers rule: recursively apply the given ‘op’ first to all of its children and then itself(Postorder Traversal). When the op does not apply to a given node, it is left unchanged.
source§

fn rewrite<R>(self, rewriter: &mut R) -> Result<Self, DataFusionError>where R: TreeNodeRewriter<N = Self>,

Transform the tree node using the given TreeNodeRewriter It performs a depth first walk of an node and its children. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V