pub struct ExprContext<T: Sized> {
pub expr: Arc<dyn PhysicalExpr>,
pub data: T,
pub children: Vec<Self>,
}
Expand description
A node object encapsulating a PhysicalExpr
node with a payload. Since there are
two ways to access child plans—directly from the plan and through child nodes—it’s
recommended to perform mutable operations via Self::update_expr_from_children
.
Fields§
§expr: Arc<dyn PhysicalExpr>
The physical expression associated with this context.
data: T
Custom data payload of the node.
children: Vec<Self>
Child contexts of this node.
Implementations§
source§impl<T> ExprContext<T>
impl<T> ExprContext<T>
pub fn new(expr: Arc<dyn PhysicalExpr>, data: T, children: Vec<Self>) -> Self
pub fn update_expr_from_children(self) -> Result<Self>
source§impl<T: Default> ExprContext<T>
impl<T: Default> ExprContext<T>
pub fn new_default(plan: Arc<dyn PhysicalExpr>) -> Self
source§impl ExprContext<ExprProperties>
impl ExprContext<ExprProperties>
sourcepub fn new_unknown(expr: Arc<dyn PhysicalExpr>) -> Self
pub fn new_unknown(expr: Arc<dyn PhysicalExpr>) -> Self
Constructs a new ExprPropertiesNode
with unknown properties for a
given physical expression. This node initializes with default properties
and recursively applies this to all child expressions.
Trait Implementations§
source§impl<T> ConcreteTreeNode for ExprContext<T>
impl<T> ConcreteTreeNode for ExprContext<T>
source§fn take_children(self) -> (Self, Vec<Self>)
fn take_children(self) -> (Self, Vec<Self>)
Detaches the node from its children, returning the node itself and its detached children.
source§fn with_new_children(self, children: Vec<Self>) -> Result<Self>
fn with_new_children(self, children: Vec<Self>) -> Result<Self>
Reattaches updated child nodes to the node, returning the updated node.
Auto Trait Implementations§
impl<T> Freeze for ExprContext<T>where
T: Freeze,
impl<T> !RefUnwindSafe for ExprContext<T>
impl<T> Send for ExprContext<T>where
T: Send,
impl<T> Sync for ExprContext<T>where
T: Sync,
impl<T> Unpin for ExprContext<T>where
T: Unpin,
impl<T> !UnwindSafe for ExprContext<T>
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
source§impl<T> TreeNode for Twhere
T: ConcreteTreeNode,
impl<T> TreeNode for Twhere
T: ConcreteTreeNode,
source§fn apply_children<'n, F>(
&'n self,
f: F,
) -> Result<TreeNodeRecursion, DataFusionError>
fn apply_children<'n, F>( &'n self, f: F, ) -> Result<TreeNodeRecursion, DataFusionError>
Low-level API used to implement other APIs. Read more
source§fn map_children<F>(self, f: F) -> Result<Transformed<T>, DataFusionError>
fn map_children<F>(self, f: F) -> Result<Transformed<T>, DataFusionError>
Low-level API used to implement other APIs. Read more
source§fn visit<'n, V>(
&'n self,
visitor: &mut V,
) -> Result<TreeNodeRecursion, DataFusionError>where
V: TreeNodeVisitor<'n, Node = Self>,
fn visit<'n, V>(
&'n self,
visitor: &mut V,
) -> Result<TreeNodeRecursion, DataFusionError>where
V: TreeNodeVisitor<'n, Node = Self>,
Visit the tree node with a
TreeNodeVisitor
, performing a
depth-first walk of the node and its children. Read moresource§fn rewrite<R>(
self,
rewriter: &mut R,
) -> Result<Transformed<Self>, DataFusionError>where
R: TreeNodeRewriter<Node = Self>,
fn rewrite<R>(
self,
rewriter: &mut R,
) -> Result<Transformed<Self>, DataFusionError>where
R: TreeNodeRewriter<Node = Self>,
Rewrite the tree node with a
TreeNodeRewriter
, performing a
depth-first walk of the node and its children. Read moresource§fn apply<'n, F>(&'n self, f: F) -> Result<TreeNodeRecursion, DataFusionError>
fn apply<'n, F>(&'n self, f: F) -> Result<TreeNodeRecursion, DataFusionError>
Applies
f
to the node then each of its children, recursively (a
top-down, pre-order traversal). Read moresource§fn transform<F>(self, f: F) -> Result<Transformed<Self>, DataFusionError>
fn transform<F>(self, f: F) -> Result<Transformed<Self>, DataFusionError>
Recursively rewrite the node’s children and then the node using
f
(a bottom-up post-order traversal). Read moresource§fn transform_down<F>(self, f: F) -> Result<Transformed<Self>, DataFusionError>
fn transform_down<F>(self, f: F) -> Result<Transformed<Self>, DataFusionError>
Recursively rewrite the tree using
f
in a top-down (pre-order)
fashion. Read moresource§fn transform_down_mut<F>(
self,
f: &mut F,
) -> Result<Transformed<Self>, DataFusionError>
fn transform_down_mut<F>( self, f: &mut F, ) -> Result<Transformed<Self>, DataFusionError>
👎Deprecated since 38.0.0: Use
transform_down
insteadSame as
Self::transform_down
but with a mutable closure.source§fn transform_up<F>(self, f: F) -> Result<Transformed<Self>, DataFusionError>
fn transform_up<F>(self, f: F) -> Result<Transformed<Self>, DataFusionError>
Recursively rewrite the node using
f
in a bottom-up (post-order)
fashion. Read moresource§fn transform_up_mut<F>(
self,
f: &mut F,
) -> Result<Transformed<Self>, DataFusionError>
fn transform_up_mut<F>( self, f: &mut F, ) -> Result<Transformed<Self>, DataFusionError>
👎Deprecated since 38.0.0: Use
transform_up
insteadSame as
Self::transform_up
but with a mutable closure.source§fn transform_down_up<FD, FU>(
self,
f_down: FD,
f_up: FU,
) -> Result<Transformed<Self>, DataFusionError>where
FD: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
FU: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
fn transform_down_up<FD, FU>(
self,
f_down: FD,
f_up: FU,
) -> Result<Transformed<Self>, DataFusionError>where
FD: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
FU: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,
Transforms the node using
f_down
while traversing the tree top-down
(pre-order), and using f_up
while traversing the tree bottom-up
(post-order). Read more