datafusion_physical_expr::tree_node

Struct ExprContext

Source
pub struct ExprContext<T> {
    pub expr: Arc<dyn PhysicalExpr>,
    pub data: T,
    pub children: Vec<ExprContext<T>>,
}
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<ExprContext<T>>

Child contexts of this node.

Implementations§

Source§

impl<T> ExprContext<T>

Source

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

Source

pub fn update_expr_from_children( self, ) -> Result<ExprContext<T>, DataFusionError>

Source§

impl<T> ExprContext<T>
where T: Default,

Source§

impl ExprContext<ExprProperties>

Source

pub fn new_unknown(expr: Arc<dyn PhysicalExpr>) -> ExprContext<ExprProperties>

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>

Source§

fn children(&self) -> &[ExprContext<T>]

Provides read-only access to child nodes.
Source§

fn take_children(self) -> (ExprContext<T>, Vec<ExprContext<T>>)

Detaches the node from its children, returning the node itself and its detached children.
Source§

fn with_new_children( self, children: Vec<ExprContext<T>>, ) -> Result<ExprContext<T>, DataFusionError>

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

impl<T> Debug for ExprContext<T>
where T: Debug,

Source§

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

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

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

Source§

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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<'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>

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>,

Visit the tree node with a 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>,

Rewrite the tree node with a TreeNodeRewriter, performing a depth-first walk of the node and its children. Read more
Source§

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 more
Source§

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

Recursively rewrite the node’s children and then the node using f (a bottom-up post-order traversal). Read more
Source§

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

Recursively rewrite the tree using f in a top-down (pre-order) fashion. Read more
Source§

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

Recursively rewrite the node using f in a bottom-up (post-order) fashion. Read more
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>,

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
Source§

fn exists<F>(&self, f: F) -> Result<bool, DataFusionError>
where F: FnMut(&Self) -> Result<bool, DataFusionError>,

Returns true if f returns true for any node in the tree. Read more
Source§

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

Source§

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>,

Source§

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.