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>

source

pub fn new(expr: Arc<dyn PhysicalExpr>, data: T, children: Vec<Self>) -> Self

source

pub fn update_expr_from_children(self) -> Result<Self>

source§

impl<T: Default> ExprContext<T>

source

pub fn new_default(plan: Arc<dyn PhysicalExpr>) -> Self

Trait Implementations§

source§

impl<T> ConcreteTreeNode for ExprContext<T>

source§

fn children(&self) -> Vec<&Self>

Provides read-only access to child nodes.
source§

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>

Reattaches updated child nodes to the node, returning the updated node.
source§

impl<T: Debug + Sized> Debug for ExprContext<T>

source§

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

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

impl<T: Display> Display for ExprContext<T>

source§

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

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T> TreeNode for T

source§

fn apply_children<F>( &self, f: &mut F ) -> Result<TreeNodeRecursion, DataFusionError>

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

fn map_children<F>(self, f: F) -> Result<Transformed<T>, DataFusionError>

Apply transform F to the node’s children. Note that the transform F might have a direction (pre-order or post-order).
source§

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

Visit the tree node using the given TreeNodeVisitor, performing a depth-first walk of the node and its children. Read more
source§

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

Implements the visitor pattern for recursively transforming TreeNodes. Read more
source§

fn apply<F>(&self, f: &mut F) -> Result<TreeNodeRecursion, DataFusionError>

Applies f to the node and its children. f is applied in a pre-order way, and it is controlled by TreeNodeRecursion, which means result of the f on a node can cause an early return. Read more
source§

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

Convenience utility for writing optimizer rules: Recursively apply the given function f to the tree in a bottom-up (post-order) fashion. When f does not apply to a given node, it is left unchanged.
source§

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

Convenience utility for writing optimizer rules: Recursively apply the given function f to a node and then to its children (pre-order traversal). When f does not apply to a given node, it is left unchanged.
source§

fn transform_down_mut<F>( self, f: &mut F ) -> Result<Transformed<Self>, DataFusionError>
where F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,

Convenience utility for writing optimizer rules: Recursively apply the given mutable function f to a node and then to its children (pre-order traversal). When f does not apply to a given node, it is left unchanged.
source§

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

Convenience utility for writing optimizer rules: Recursively apply the given function f to all children of a node, and then to the node itself (post-order traversal). When f does not apply to a given node, it is left unchanged.
source§

fn transform_up_mut<F>( self, f: &mut F ) -> Result<Transformed<Self>, DataFusionError>
where F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,

Convenience utility for writing optimizer rules: Recursively apply the given mutable function f to all children of a node, and then to the node itself (post-order traversal). When f does not apply to a given node, it is left unchanged.
source§

fn transform_down_up<FD, FU>( self, f_down: &mut FD, f_up: &mut FU ) -> Result<Transformed<Self>, DataFusionError>
where FD: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>, FU: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,

Transforms the tree 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
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

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

source§

fn vzip(self) -> V