pub struct ExprOrdering {
pub expr: Arc<dyn PhysicalExpr>,
pub state: SortProperties,
pub children_states: 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: SortProperties§children_states: Vec<SortProperties>Implementations§
source§impl ExprOrdering
impl ExprOrdering
sourcepub fn new(expr: Arc<dyn PhysicalExpr>) -> Self
pub fn new(expr: Arc<dyn PhysicalExpr>) -> Self
Creates a new ExprOrdering with SortProperties::Unordered states
for expr and its children.
sourcepub fn with_new_children(self, children_states: Vec<SortProperties>) -> Self
pub fn with_new_children(self, children_states: Vec<SortProperties>) -> Self
Updates this ExprOrdering’s children states with the given states.
sourcepub fn children_expr_orderings(&self) -> Vec<ExprOrdering>
pub fn children_expr_orderings(&self) -> Vec<ExprOrdering>
Creates new ExprOrdering objects for each child of the expression.
Trait Implementations§
source§impl Debug for ExprOrdering
impl Debug for ExprOrdering
source§impl TreeNode for ExprOrdering
impl TreeNode for ExprOrdering
source§fn apply_children<F>(&self, op: &mut F) -> Result<VisitRecursion>where
F: FnMut(&Self) -> Result<VisitRecursion>,
fn apply_children<F>(&self, op: &mut F) -> Result<VisitRecursion>where F: FnMut(&Self) -> Result<VisitRecursion>,
F to the node’s childrensource§fn map_children<F>(self, transform: F) -> Result<Self>where
F: FnMut(Self) -> Result<Self>,
fn map_children<F>(self, transform: F) -> Result<Self>where F: FnMut(Self) -> Result<Self>,
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>,
fn apply<F>(&self, op: &mut F) -> Result<VisitRecursion, DataFusionError>where F: FnMut(&Self) -> Result<VisitRecursion, DataFusionError>,
source§fn visit<V>(&self, visitor: &mut V) -> Result<VisitRecursion, DataFusionError>where
V: TreeNodeVisitor<N = Self>,
fn visit<V>(&self, visitor: &mut V) -> Result<VisitRecursion, DataFusionError>where V: TreeNodeVisitor<N = Self>,
source§fn transform<F>(self, op: &F) -> Result<Self, DataFusionError>where
F: Fn(Self) -> Result<Transformed<Self>, DataFusionError>,
fn transform<F>(self, op: &F) -> Result<Self, DataFusionError>where F: Fn(Self) -> Result<Transformed<Self>, DataFusionError>,
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>,
fn transform_down<F>(self, op: &F) -> Result<Self, DataFusionError>where F: Fn(Self) -> Result<Transformed<Self>, DataFusionError>,
op does not apply to a given node, it is left unchanged.source§fn transform_down_mut<F>(self, op: &mut F) -> Result<Self, DataFusionError>where
F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
fn transform_down_mut<F>(self, op: &mut F) -> Result<Self, DataFusionError>where F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
F.
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>,
fn transform_up<F>(self, op: &F) -> Result<Self, DataFusionError>where F: Fn(Self) -> Result<Transformed<Self>, DataFusionError>,
op does not apply to a given node, it is left unchanged.source§fn transform_up_mut<F>(self, op: &mut F) -> Result<Self, DataFusionError>where
F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
fn transform_up_mut<F>(self, op: &mut F) -> Result<Self, DataFusionError>where F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
F.
When the op does not apply to a given node, it is left unchanged.