Module datafusion_common::tree_node
source · Expand description
This module provides common traits for visiting or rewriting tree data structures easily.
Enums§
- Controls how the
TreeNoderecursion should proceed forTreeNode::rewrite. - Controls how the
TreeNoderecursion should proceed forTreeNode::visit.
Traits§
- Instead of implementing
TreeNode, it’s recommended to implement aConcreteTreeNodefor trees that contain nodes with payloads. This approach ensures safe execution of algorithms involving payloads, by enforcing rules for detaching and reattaching child nodes. - Helper trait for implementing
TreeNodethat have children stored as Arc’s - Defines a visitable and rewriteable a tree node. This trait is implemented for plans (
ExecutionPlanandLogicalPlan) as well as expression trees (PhysicalExpr,Expr) in DataFusion - Trait for potentially recursively transform an
TreeNodenode tree. When passed toTreeNode::rewrite,TreeNodeRewriter::mutateis invoked recursively on all nodes of a tree. - Implements the visitor pattern for recursively walking
TreeNodes.