Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
LogicalPlan in datafusion::logical_expr - Rust
[go: Go Back, main page]

datafusion::logical_expr

Enum LogicalPlan

source
pub enum LogicalPlan {
Show 27 variants Projection(Projection), Filter(Filter), Window(Window), Aggregate(Aggregate), Sort(Sort), Join(Join), CrossJoin(CrossJoin), Repartition(Repartition), Union(Union), TableScan(TableScan), EmptyRelation(EmptyRelation), Subquery(Subquery), SubqueryAlias(SubqueryAlias), Limit(Limit), Statement(Statement), Values(Values), Explain(Explain), Analyze(Analyze), Extension(Extension), Distinct(Distinct), Prepare(Prepare), Dml(DmlStatement), Ddl(DdlStatement), Copy(CopyTo), DescribeTable(DescribeTable), Unnest(Unnest), RecursiveQuery(RecursiveQuery),
}
Expand description

A LogicalPlan is a node in a tree of relational operators (such as Projection or Filter).

Represents transforming an input relation (table) to an output relation (table) with a potentially different schema. Plans form a dataflow tree where data flows from leaves up to the root to produce the query result.

LogicalPlans can be created by the SQL query planner, the DataFrame API, or programmatically (for example custom query languages).

ยงSee also:

ยงExamples

ยงCreating a LogicalPlan from SQL:

See SessionContext::sql

ยงCreating a LogicalPlan from the DataFrame API:

See DataFrame::logical_plan

ยงCreating a LogicalPlan programmatically:

See LogicalPlanBuilder

ยงVisiting and Rewriting LogicalPlans

Using the tree_node API, you can recursively walk all nodes in a LogicalPlan. For example, to find all column references in a plan:

// Projection(name, salary)
//   Filter(salary > 1000)
//     TableScan(employee)
let plan = table_scan(Some("employee"), &employee_schema(), None)?
 .filter(col("salary").gt(lit(1000)))?
 .project(vec![col("name")])?
 .build()?;

// use apply to walk the plan and collect all expressions
let mut expressions = HashSet::new();
plan.apply(|node| {
  // collect all expressions in the plan
  node.apply_expressions(|expr| {
   expressions.insert(expr.clone());
   Ok(TreeNodeRecursion::Continue) // control walk of expressions
  })?;
  Ok(TreeNodeRecursion::Continue) // control walk of plan nodes
}).unwrap();

// we found the expression in projection and filter
assert_eq!(expressions.len(), 2);
println!("Found expressions: {:?}", expressions);
// found predicate in the Filter: employee.salary > 1000
let salary = Expr::Column(Column::new(Some("employee"), "salary"));
assert!(expressions.contains(&salary.gt(lit(1000))));
// found projection in the Projection: employee.name
let name = Expr::Column(Column::new(Some("employee"), "name"));
assert!(expressions.contains(&name));

You can also rewrite plans using the tree_node API. For example, to replace the filter predicate in a plan:

// Projection(name, salary)
//   Filter(salary > 1000)
//     TableScan(employee)
use datafusion_common::tree_node::Transformed;
let plan = table_scan(Some("employee"), &employee_schema(), None)?
 .filter(col("salary").gt(lit(1000)))?
 .project(vec![col("name")])?
 .build()?;

// use transform to rewrite the plan
let transformed_result = plan.transform(|node| {
  // when we see the filter node
  if let LogicalPlan::Filter(mut filter) = node {
    // replace predicate with salary < 2000
    filter.predicate = Expr::Column(Column::new(Some("employee"), "salary")).lt(lit(2000));
    let new_plan = LogicalPlan::Filter(filter);
    return Ok(Transformed::yes(new_plan)); // communicate the node was changed
  }
  // return the node unchanged
  Ok(Transformed::no(node))
}).unwrap();

// Transformed result contains rewritten plan and information about
// whether the plan was changed
assert!(transformed_result.transformed);
let rewritten_plan = transformed_result.data;

// we found the filter
assert_eq!(rewritten_plan.display_indent().to_string(),
"Projection: employee.name\
\n  Filter: employee.salary < Int32(2000)\
\n    TableScan: employee");

Variantsยง

ยง

Projection(Projection)

Evaluates an arbitrary list of expressions (essentially a SELECT with an expression list) on its input.

ยง

Filter(Filter)

Filters rows from its input that do not match an expression (essentially a WHERE clause with a predicate expression).

Semantically, <predicate> is evaluated for each row of the input; If the value of <predicate> is true, the input row is passed to the output. If the value of <predicate> is false (or null), the row is discarded.

ยง

Window(Window)

Windows input based on a set of window spec and window function (e.g. SUM or RANK). This is used to implement SQL window functions, and the OVER clause.

ยง

Aggregate(Aggregate)

Aggregates its input based on a set of grouping and aggregate expressions (e.g. SUM). This is used to implement SQL aggregates and GROUP BY.

ยง

Sort(Sort)

Sorts its input according to a list of sort expressions. This is used to implement SQL ORDER BY

ยง

Join(Join)

Join two logical plans on one or more join columns. This is used to implement SQL JOIN

ยง

CrossJoin(CrossJoin)

Apply Cross Join to two logical plans. This is used to implement SQL CROSS JOIN

ยง

Repartition(Repartition)

Repartitions the input based on a partitioning scheme. This is used to add parallelism and is sometimes referred to as an โ€œexchangeโ€ operator in other systems

ยง

Union(Union)

Union multiple inputs with the same schema into a single output stream. This is used to implement SQL UNION [ALL] and INTERSECT [ALL].

ยง

TableScan(TableScan)

Produces rows from a TableSource, used to implement SQL FROM tables or views.

ยง

EmptyRelation(EmptyRelation)

Produces no rows: An empty relation with an empty schema that produces 0 or 1 row. This is used to implement SQL SELECT that has no values in the FROM clause.

ยง

Subquery(Subquery)

Produces the output of running another query. This is used to implement SQL subqueries

ยง

SubqueryAlias(SubqueryAlias)

Aliased relation provides, or changes, the name of a relation.

ยง

Limit(Limit)

Skip some number of rows, and then fetch some number of rows.

ยง

Statement(Statement)

A DataFusion Statement such as SET VARIABLE or START TRANSACTION

ยง

Values(Values)

Values expression. See Postgres VALUES documentation for more details. This is used to implement SQL such as VALUES (1, 2), (3, 4)

ยง

Explain(Explain)

Produces a relation with string representations of various parts of the plan. This is used to implement SQL EXPLAIN.

ยง

Analyze(Analyze)

Runs the input, and prints annotated physical plan as a string with execution metric. This is used to implement SQL EXPLAIN ANALYZE.

ยง

Extension(Extension)

Extension operator defined outside of DataFusion. This is used to extend DataFusion with custom relational operations that

ยง

Distinct(Distinct)

Remove duplicate rows from the input. This is used to implement SQL SELECT DISTINCT ....

ยง

Prepare(Prepare)

Prepare a statement and find any bind parameters (e.g. ?). This is used to implement SQL-prepared statements.

ยง

Dml(DmlStatement)

Data Manipulation Language (DML): Insert / Update / Delete

ยง

Ddl(DdlStatement)

Data Definition Language (DDL): CREATE / DROP TABLES / VIEWS / SCHEMAS

ยง

Copy(CopyTo)

COPY TO for writing plan results to files

ยง

DescribeTable(DescribeTable)

Describe the schema of the table. This is used to implement the SQL DESCRIBE command from MySQL.

ยง

Unnest(Unnest)

Unnest a column that contains a nested list type such as an ARRAY. This is used to implement SQL UNNEST

ยง

RecursiveQuery(RecursiveQuery)

A variadic query (e.g. โ€œRecursive CTEsโ€)

Implementationsยง

sourceยง

impl LogicalPlan

source

pub fn schema(&self) -> &Arc<DFSchema>

Get a reference to the logical planโ€™s schema

source

pub fn fallback_normalize_schemas(&self) -> Vec<&DFSchema>

Used for normalizing columns, as the fallback schemas to the main schema of the plan.

source

pub fn explain_schema() -> Arc<Schema>

Returns the (fixed) output schema for explain plans

source

pub fn describe_schema() -> Schema

Returns the (fixed) output schema for DESCRIBE plans

source

pub fn expressions(&self) -> Vec<Expr>

Returns all expressions (non-recursively) evaluated by the current logical plan node. This does not include expressions in any children.

Note this method clones all the expressions. When possible, the tree_node API should be used instead of this API.

The returned expressions do not necessarily represent or even contributed to the output schema of this node. For example, LogicalPlan::Filter returns the filter expression even though the output of a Filter has the same columns as the input.

The expressions do contain all the columns that are used by this plan, so if there are columns not referenced by these expressions then DataFusionโ€™s optimizer attempts to optimize them away.

source

pub fn all_out_ref_exprs(&self) -> Vec<Expr>

Returns all the out reference(correlated) expressions (recursively) in the current logical plan nodes and all its descendant nodes.

source

pub fn inspect_expressions<F, E>(&self, f: F) -> Result<(), E>
where F: FnMut(&Expr) -> Result<(), E>,

๐Ÿ‘ŽDeprecated since 37.0.0: Use apply_expressions instead
source

pub fn inputs(&self) -> Vec<&LogicalPlan>

Returns all inputs / children of this LogicalPlan node.

Note does not include inputs to inputs, or subqueries.

source

pub fn using_columns(&self) -> Result<Vec<HashSet<Column>>, DataFusionError>

returns all Using join columns in a logical plan

source

pub fn head_output_expr(&self) -> Result<Option<Expr>, DataFusionError>

returns the first output expression of this LogicalPlan node.

source

pub fn recompute_schema(self) -> Result<LogicalPlan, DataFusionError>

Recomputes schema and type information for this LogicalPlan if needed.

Some LogicalPlans may need to recompute their schema if the number or type of expressions have been changed (for example due to type coercion). For example LogicalPlan::Projections schema depends on its expressions.

Some LogicalPlans schema is unaffected by any changes to their expressions. For example LogicalPlan::Filter schema is always the same as its input schema.

This is useful after modifying a plans Exprs (or input plans) via methods such as Self::map_children and Self::map_expressions. Unlike Self::with_new_exprs, this method does not require a new set of expressions or inputs plans.

ยงReturn value

Returns an error if there is some issue recomputing the schema.

ยงNotes
  • Does not recursively recompute schema for input (child) plans.
source

pub fn with_new_exprs( &self, expr: Vec<Expr>, inputs: Vec<LogicalPlan>, ) -> Result<LogicalPlan, DataFusionError>

Returns a new LogicalPlan based on self with inputs and expressions replaced.

Note this method creates an entirely new node, which requires a large amount of cloneโ€™ing. When possible, the tree_node API should be used instead of this API.

The exprs correspond to the same order of expressions returned by Self::expressions. This function is used by optimizers to rewrite plans using the following pattern:

let new_inputs = optimize_children(..., plan, props);

// get the plans expressions to optimize
let exprs = plan.expressions();

// potentially rewrite plan expressions
let rewritten_exprs = rewrite_exprs(exprs);

// create new plan using rewritten_exprs in same position
let new_plan = plan.new_with_exprs(rewritten_exprs, new_inputs);
source

pub fn with_param_values( self, param_values: impl Into<ParamValues>, ) -> Result<LogicalPlan, DataFusionError>

Replaces placeholder param values (like $1, $2) in LogicalPlan with the specified param_values.

LogicalPlan::Prepare are converted to their inner logical plan for execution.

ยงExample
use datafusion_common::ScalarValue;
// Build SELECT * FROM t1 WHRERE id = $1
let plan = table_scan(Some("t1"), &schema, None).unwrap()
    .filter(col("id").eq(placeholder("$1"))).unwrap()
    .build().unwrap();

assert_eq!(
  "Filter: t1.id = $1\
  \n  TableScan: t1",
  plan.display_indent().to_string()
);

// Fill in the parameter $1 with a literal 3
let plan = plan.with_param_values(vec![
  ScalarValue::from(3i32) // value at index 0 --> $1
]).unwrap();

assert_eq!(
   "Filter: t1.id = Int32(3)\
   \n  TableScan: t1",
   plan.display_indent().to_string()
 );

// Note you can also used named parameters
// Build SELECT * FROM t1 WHRERE id = $my_param
let plan = table_scan(Some("t1"), &schema, None).unwrap()
    .filter(col("id").eq(placeholder("$my_param"))).unwrap()
    .build().unwrap()
    // Fill in the parameter $my_param with a literal 3
    .with_param_values(vec![
      ("my_param", ScalarValue::from(3i32)),
    ]).unwrap();

assert_eq!(
   "Filter: t1.id = Int32(3)\
   \n  TableScan: t1",
   plan.display_indent().to_string()
 );
source

pub fn max_rows(&self) -> Option<usize>

Returns the maximum number of rows that this plan can output, if known.

If None, the plan can return any number of rows. If Some(n) then the plan can return at most n rows but may return fewer.

source

pub fn contains_outer_reference(&self) -> bool

If this nodeโ€™s expressions contains any references to an outer subquery

source

pub fn columnized_output_exprs( &self, ) -> Result<Vec<(&Expr, Column)>, DataFusionError>

Get the output expressions and their corresponding columns.

The parent node may reference the output columns of the plan by expressions, such as projection over aggregate or window functions. This method helps to convert the referenced expressions into columns.

See also: crate::utils::columnize_expr

sourceยง

impl LogicalPlan

source

pub fn replace_params_with_values( self, param_values: &ParamValues, ) -> Result<LogicalPlan, DataFusionError>

Return a LogicalPlan with all placeholders (e.g $1 $2, โ€ฆ) replaced with corresponding values provided in params_values

See Self::with_param_values for examples and usage with an owned ParamValues

source

pub fn get_parameter_types( &self, ) -> Result<HashMap<String, Option<DataType>>, DataFusionError>

Walk the logical plan, find any Placeholder tokens, and return a map of their IDs and DataTypes

source

pub fn display_indent(&self) -> impl Display

Return a formatable structure that produces a single line per node.

ยงExample
Projection: employee.id
   Filter: employee.state Eq Utf8(\"CO\")\
      CsvScan: employee projection=Some([0, 3])
use arrow::datatypes::{Field, Schema, DataType};
use datafusion_expr::{lit, col, LogicalPlanBuilder, logical_plan::table_scan};
let schema = Schema::new(vec![
    Field::new("id", DataType::Int32, false),
]);
let plan = table_scan(Some("t1"), &schema, None).unwrap()
    .filter(col("id").eq(lit(5))).unwrap()
    .build().unwrap();

// Format using display_indent
let display_string = format!("{}", plan.display_indent());

assert_eq!("Filter: t1.id = Int32(5)\n  TableScan: t1",
            display_string);
source

pub fn display_indent_schema(&self) -> impl Display

Return a formatable structure that produces a single line per node that includes the output schema. For example:

Projection: employee.id [id:Int32]\
   Filter: employee.state = Utf8(\"CO\") [id:Int32, state:Utf8]\
     TableScan: employee projection=[0, 3] [id:Int32, state:Utf8]";
use arrow::datatypes::{Field, Schema, DataType};
use datafusion_expr::{lit, col, LogicalPlanBuilder, logical_plan::table_scan};
let schema = Schema::new(vec![
    Field::new("id", DataType::Int32, false),
]);
let plan = table_scan(Some("t1"), &schema, None).unwrap()
    .filter(col("id").eq(lit(5))).unwrap()
    .build().unwrap();

// Format using display_indent_schema
let display_string = format!("{}", plan.display_indent_schema());

assert_eq!("Filter: t1.id = Int32(5) [id:Int32]\
            \n  TableScan: t1 [id:Int32]",
            display_string);
source

pub fn display_pg_json(&self) -> impl Display

Return a displayable structure that produces plan in postgresql JSON format.

Users can use this format to visualize the plan in existing plan visualization tools, for example dalibo

source

pub fn display_graphviz(&self) -> impl Display

Return a formatable structure that produces lines meant for graphical display using the DOT language. This format can be visualized using software from graphviz

This currently produces two graphs โ€“ one with the basic structure, and one with additional details such as schema.

use arrow::datatypes::{Field, Schema, DataType};
use datafusion_expr::{lit, col, LogicalPlanBuilder, logical_plan::table_scan};
let schema = Schema::new(vec![
    Field::new("id", DataType::Int32, false),
]);
let plan = table_scan(Some("t1"), &schema, None).unwrap()
    .filter(col("id").eq(lit(5))).unwrap()
    .build().unwrap();

// Format using display_graphviz
let graphviz_string = format!("{}", plan.display_graphviz());

If graphviz string is saved to a file such as /tmp/example.dot, the following commands can be used to render it as a pdf:

  dot -Tpdf < /tmp/example.dot  > /tmp/example.pdf
source

pub fn display(&self) -> impl Display

Return a formatable structure with the a human readable description of this LogicalPlan node per node, not including children. For example:

Projection: id
use arrow::datatypes::{Field, Schema, DataType};
use datafusion_expr::{lit, col, LogicalPlanBuilder, logical_plan::table_scan};
let schema = Schema::new(vec![
    Field::new("id", DataType::Int32, false),
]);
let plan = table_scan(Some("t1"), &schema, None).unwrap()
    .build().unwrap();

// Format using display
let display_string = format!("{}", plan.display());

assert_eq!("TableScan: t1", display_string);
sourceยง

impl LogicalPlan

source

pub fn apply_expressions<F>( &self, f: F, ) -> Result<TreeNodeRecursion, DataFusionError>

Calls f on all expressions in the current LogicalPlan node.

ยงNotes
  • Similar to TreeNode::apply but for this nodeโ€™s expressions.
  • Does not include expressions in input LogicalPlan nodes
  • Visits only the top level expressions (Does not recurse into each expression)
source

pub fn map_expressions<F>( self, f: F, ) -> Result<Transformed<LogicalPlan>, DataFusionError>

Rewrites all expressions in the current LogicalPlan node using f.

Returns the current node.

ยงNotes
  • Similar to TreeNode::map_children but for this nodeโ€™s expressions.
  • Visits only the top level expressions (Does not recurse into each expression)
source

pub fn visit_with_subqueries<V>( &self, visitor: &mut V, ) -> Result<TreeNodeRecursion, DataFusionError>
where V: for<'n> TreeNodeVisitor<'n, Node = LogicalPlan>,

Visits a plan similarly to Self::visit, including subqueries that may appear in expressions such as IN (SELECT ...).

source

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

Similarly to Self::rewrite, rewrites this node and its inputs using f, including subqueries that may appear in expressions such as IN (SELECT ...).

source

pub fn apply_with_subqueries<F>( &self, f: F, ) -> Result<TreeNodeRecursion, DataFusionError>

Similarly to Self::apply, calls f on this node and all its inputs, including subqueries that may appear in expressions such as IN (SELECT ...).

source

pub fn transform_with_subqueries<F>( self, f: F, ) -> Result<Transformed<LogicalPlan>, DataFusionError>

Similarly to Self::transform, rewrites this node and its inputs using f, including subqueries that may appear in expressions such as IN (SELECT ...).

source

pub fn transform_down_with_subqueries<F>( self, f: F, ) -> Result<Transformed<LogicalPlan>, DataFusionError>

Similarly to Self::transform_down, rewrites this node and its inputs using f, including subqueries that may appear in expressions such as IN (SELECT ...).

source

pub fn transform_up_with_subqueries<F>( self, f: F, ) -> Result<Transformed<LogicalPlan>, DataFusionError>

Similarly to Self::transform_up, rewrites this node and its inputs using f, including subqueries that may appear in expressions such as IN (SELECT ...).

source

pub fn transform_down_up_with_subqueries<FD, FU>( self, f_down: FD, f_up: FU, ) -> Result<Transformed<LogicalPlan>, DataFusionError>

Similarly to Self::transform_down, rewrites this node and its inputs using f, including subqueries that may appear in expressions such as IN (SELECT ...).

source

pub fn apply_subqueries<F>( &self, f: F, ) -> Result<TreeNodeRecursion, DataFusionError>

Similarly to Self::apply, calls f on this node and its inputs including subqueries that may appear in expressions such as IN (SELECT ...).

source

pub fn map_subqueries<F>( self, f: F, ) -> Result<Transformed<LogicalPlan>, DataFusionError>

Similarly to Self::map_children, rewrites all subqueries that may appear in expressions such as IN (SELECT ...) using f.

Returns the current node.

Trait Implementationsยง

sourceยง

impl Clone for LogicalPlan

sourceยง

fn clone(&self) -> LogicalPlan

Returns a copy of the value. Read more
1.0.0 ยท sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
sourceยง

impl Debug for LogicalPlan

sourceยง

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

Formats the value using the given formatter. Read more
sourceยง

impl Default for LogicalPlan

sourceยง

fn default() -> LogicalPlan

Returns the โ€œdefault valueโ€ for a type. Read more
sourceยง

impl Display for LogicalPlan

sourceยง

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

Formats the value using the given formatter. Read more
sourceยง

impl From<LogicalPlan> for LogicalPlanBuilder

sourceยง

fn from(plan: LogicalPlan) -> LogicalPlanBuilder

Converts to this type from the input type.
sourceยง

impl Hash for LogicalPlan

sourceยง

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 ยท sourceยง

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
sourceยง

impl PartialEq for LogicalPlan

sourceยง

fn eq(&self, other: &LogicalPlan) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
sourceยง

impl ToStringifiedPlan for LogicalPlan

sourceยง

fn to_stringified(&self, plan_type: PlanType) -> StringifiedPlan

Create a stringified plan with the specified type
sourceยง

impl TreeNode for LogicalPlan

sourceยง

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

Applies f to each child (input) of this plan node, rewriting them in place.

ยงNotes

Inputs include ONLY direct children, not embedded LogicalPlans for subqueries, for example such as are in Expr::Exists.

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 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_down_mut<F>( self, f: &mut F, ) -> Result<Transformed<Self>, DataFusionError>
where F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,

๐Ÿ‘ŽDeprecated since 38.0.0: Use transform_down instead
Same as Self::transform_down but with a mutable closure.
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_up_mut<F>( self, f: &mut F, ) -> Result<Transformed<Self>, DataFusionError>
where F: FnMut(Self) -> Result<Transformed<Self>, DataFusionError>,

๐Ÿ‘ŽDeprecated since 38.0.0: Use transform_up instead
Same 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>,

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 Eq for LogicalPlan

sourceยง

impl StructuralPartialEq for LogicalPlan

Auto Trait Implementationsยง

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> CloneToUninit for T
where T: Clone,

sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut T)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

sourceยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

sourceยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

sourceยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

sourceยง

type Output = T

Should always be Self
sourceยง

impl<T> ToOwned for T
where T: Clone,

sourceยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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, 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.
sourceยง

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

sourceยง

fn vzip(self) -> V