pub struct LogicalPlanBuilder { /* private fields */ }
Expand description

Builder for logical plans

// Create a plan similar to
// SELECT last_name
// FROM employees
// WHERE salary < 1000
let plan = table_scan(
             Some("employee"),
             &employee_schema(),
             None,
           )?
           // Keep only rows where salary < 1000
           .filter(col("salary").lt_eq(lit(1000)))?
           // only show "last_name" in the final results
           .project(vec![col("last_name")])?
           .build()?;

Implementations

Create a builder from an existing plan

Return the output schema of the plan build so far

Create an empty relation.

produce_one_row set to true means this empty node needs to produce a placeholder row.

Create a values list based relation, and the schema is inferred from data, consuming value. See the Postgres VALUES documentation for more details.

By default, it assigns the names column1, column2, etc. to the columns of a VALUES table. The column names are not specified by the SQL standard and different database systems do it differently, so it’s usually better to override the default names with a table alias list.

Convert a table provider into a builder with a TableScan

Convert a table provider into a builder with a TableScan

Wrap a plan in a window

Apply a projection without alias.

Apply a projection with alias

Apply a filter

Limit the number of rows returned

skip - Number of rows to skip before fetch any row.

fetch - Maximum number of rows to fetch, after skipping skip rows, if specified.

Apply an alias

Apply a sort

Apply a union, preserving duplicate rows

Apply a union, removing duplicate rows

Apply deduplication: Only distinct (different) values are returned)

Apply a join with on constraint.

Filter expression expected to contain non-equality predicates that can not be pushed down to any of join inputs. In case of outer join, filter applied to only matched rows.

Apply a join with on constraint and specified null equality If null_equals_null is true then null == null, else null != null

Apply a join with using constraint, which duplicates all join columns in output schema.

Apply a cross join

Repartition

Apply a window functions to extend the schema

Apply an aggregate: grouping on the group_expr expressions and calculating aggr_expr aggregates for each distinct value of the group_expr;

Create an expression to represent the explanation of the plan

if analyze is true, runs the actual plan and produces information about metrics during run.

if verbose is true, prints out additional details.

Process intersect set operator

Process except set operator

Build the plan

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.