[][src]Module datafusion::logical_plan

This module provides a logical query plan enum that can describe queries. Logical query plans can be created from a SQL statement or built programmatically via the Table API.

Logical query plans can then be optimized and executed directly, or translated into physical query plans and executed.

Structs

DFField

DFField wraps an Arrow field and adds an optional qualifier

DFSchema

DFSchema wraps an Arrow schema and adds relation names

LogicalPlanBuilder

Builder for logical plans

StringifiedPlan

Represents some sort of execution plan, in String form

Enums

Expr

Expr is a logical expression. A logical expression is something like 1 + 1, or CAST(c1 AS int). Logical expressions know how to compute its arrow::datatypes::DataType and nullability. Expr is a central struct of DataFusion's query API.

JoinType

Join type

LogicalPlan

A LogicalPlan represents the different types of relational operators (such as Projection, Filter, etc) and can be created by the SQL query planner and the DataFrame API.

Operator

Operators applied to expressions

Partitioning

Logical partitioning schemes supported by the repartition operator.

PlanType

Represents which type of plan

Traits

FunctionRegistry

A registry knows how to build logical expressions out of user-defined function' names

Literal

Whether it can be represented as a literal expression

PlanVisitor

Trait that implements the Visitor pattern for a depth first walk of LogicalPlan nodes. pre_visit is called before any children are visited, and then post_visit is called after all children have been visited. To use, define a struct that implements this trait and then invoke "LogicalPlan::accept".

ToDFSchema

Convenience trait to convert Schema like things to DFSchema and DFSchemaRef with fewer keystrokes

UserDefinedLogicalNode

This defines the interface for LogicalPlan nodes that can be used to extend DataFusion with custom relational operators.

Functions

abs
acos
and

return a new expression with a logical AND

array

returns an array of fixed size with each argument on it.

asin
atan
avg

Create an expression to represent the avg() aggregate function

binary_expr

return a new expression l r

case

Create a CASE WHEN statement with literal WHEN expressions for comparison to the base expression.

ceil
col

Create a column expression based on a column name

concat

returns the concatenation of string expressions

cos
count

Create an expression to represent the count() aggregate function

count_distinct

Create an expression to represent the count(distinct) aggregate function

create_udaf

Creates a new UDAF with a specific signature, state type and return type. The signature and state type must match the Acumulator's implementation.

create_udf

Creates a new UDF with a specific signature and specific return type. This is a helper function to create a new UDF. The function create_udf returns a subset of all possible ScalarFunction:

display_schema

Print the schema in a compact representation to buf

exp
exprlist_to_fields

Create field meta-data from an expression, for use in a result set schema

floor
in_list

Create an in_list expression

length

returns the length of a string in bytes

lit

Create a literal expression

ln
log2
log10
lower
ltrim
max

Create an expression to represent the max() aggregate function

md5
min

Create an expression to represent the min() aggregate function

or

return a new expression with a logical OR

round
rtrim
sha224
sha256
sha384
sha512
signum
sin
sqrt
sum

Create an expression to represent the sum() aggregate function

tan
trim
trunc
upper
when

Create a CASE WHEN statement with boolean WHEN expressions and no base expression.

Type Definitions

DFSchemaRef

A reference-counted reference to a DFSchema.