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.

If the values include params/binders such as $1, $2, $3, etc, then the param_data_types should be provided.

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.

Select the given column indices

Apply a filter

Make a builder for a prepare logical plan from the builder’s plan

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

Apply a join with the expression on constraint.

equi_exprs are “equijoin” predicates expressions on the existing and right inputs, respectively.

filter: any other filter expression to apply during the join. equi_exprs predicates are likely to be evaluated more quickly than the filter expressions

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.