Skip to main content

LogicalPlan

Type Alias LogicalPlan 

Source
pub type LogicalPlan = LogicalPlan;
Expand description

A DataFusion datafusion::logical_expr::LogicalPlan produced by the relational lowering pass.

Using a type alias means all downstream code (including graphforge-exec) works directly with the native DataFusion type without any wrapping overhead.

Aliased Type§

pub enum LogicalPlan {
Show 25 variants Projection(Projection), Filter(Filter), Window(Window), Aggregate(Aggregate), Sort(Sort), Join(Join), 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), Dml(DmlStatement), Ddl(DdlStatement), Copy(CopyTo), DescribeTable(DescribeTable), Unnest(Unnest), RecursiveQuery(RecursiveQuery),
}

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.

See [Window] for more details

§

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.

See [Aggregate] for more details

§

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

§

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

§

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”)