Expand description

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.

Re-exports

pub use plan::CreateExternalTable;
pub use plan::CreateMemoryTable;
pub use plan::CrossJoin;
pub use plan::DropTable;
pub use plan::EmptyRelation;
pub use plan::JoinConstraint;
pub use plan::JoinType;
pub use plan::Limit;
pub use plan::LogicalPlan;
pub use plan::Partitioning;
pub use plan::PlanType;
pub use plan::PlanVisitor;
pub use plan::Repartition;
pub use plan::TableScan;
pub use plan::Union;
pub use plan::Values;

Modules

This module contains the LogicalPlan enum that describes queries via a logical query plan.

Window frame types, reimported from datafusion_expr

Structs

A named reference to a qualified field in a schema.

DFField wraps an Arrow field and adds an optional qualifier

DFSchema wraps an Arrow schema and adds relation names

Builder for logical plans

Enums

Expr is a central struct of DataFusion’s query API, and represent logical expressions such as A + 1, or CAST(c1 AS int).

Operators applied to expressions

Controls how the visitor recursion should proceed.

Controls how the ExprRewriter recursion should proceed.

Constants

Default table name for unnamed table

Traits

a trait for marking types that are rewritable by ExprRewriter

Trait for potentially recursively rewriting an Expr expression tree. When passed to Expr::rewrite, ExpressionVisitor::mutate is invoked recursively on all nodes of an expression tree. See the comments on Expr::rewrite for details on its use

Provides schema information needed by [Expr] methods such as [Expr::nullable] and [Expr::data_type].

trait to allow expr to typable with respect to a schema

trait for types that can be simplified

trait for types that can be visited by ExpressionVisitor

Encode the traversal of an expression tree. When passed to Expr::accept, ExpressionVisitor::visit is invoked recursively on all nodes of an expression tree. See the comments on Expr::accept for details on its use

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

Trait for converting a type to a Literal literal expression.

The information necessary to apply algebraic simplification to an Expr. See [SimplifyContext] for one implementation

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

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

Functions

Unary scalar function definition for abs

Unary scalar function definition for acos

Return a new expression with a logical AND

Returns the approximate number of distinct input values. This function provides an approximation of count(DISTINCT x). Zero is returned if all input values are null. This function should produce a standard error of 0.81%, which is the standard deviation of the (approximately normal) error distribution over all possible sets. It does not guarantee an upper bound on the error for any specific input set.

Calculate an approximation of the specified percentile for expr.

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

Scalar function definition for ascii

Unary scalar function definition for asin

Unary scalar function definition for atan

Create an expression to represent the avg() aggregate function

Return a new expression l r

Scalar function definition for bit_length

Scalar function definition for btrim

Creates a schema for a join operation. The fields from the left side are first

Calls a named built in function

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

Unary scalar function definition for ceil

Scalar function definition for character_length

Scalar function definition for chr

Create a column expression based on a qualified or unqualified column name

Convert an expression into Column expression if it’s already provided as input plan.

Combines an array of filter expressions into a single filter expression consisting of the input filter expressions joined with logical AND. Returns None if the filters array is empty.

Concatenates the text representations of all the arguments. NULL arguments are ignored.

Concatenates all but the first argument, with separators. The first argument is used as the separator string, and should not be NULL. Other NULL arguments are ignored.

Unary scalar function definition for cos

Create an expression to represent the count() aggregate function

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

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

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:

Scalar function definition for date_part

Scalar function definition for date_trunc

Scalar function definition for digest

Print the schema in a compact representation to buf

Unary scalar function definition for exp

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

Unary scalar function definition for floor

Create an in_list expression

Scalar function definition for initcap

Scalar function definition for left

Scalar function definition for length

Create a literal expression

Create a literal timestamp expression

Unary scalar function definition for ln

Unary scalar function definition for log2

Unary scalar function definition for log10

Scalar function definition for lower

Scalar function definition for lpad

Scalar function definition for ltrim

Create an expression to represent the max() aggregate function

Scalar function definition for md5

Create an expression to represent the min() aggregate function

Recursively call Column::normalize_with_schemas on all Column expressions in the expr expression tree.

Recursively normalize all Column expressions in a list of expression trees

Unary scalar function definition for now

Scalar function definition for octet_length

Return a new expression with a logical OR

Returns a random value in the range 0.0 <= x < 1.0

Scalar function definition for regexp_match

Scalar function definition for regexp_replace

Scalar function definition for repeat

Scalar function definition for replace

Recursively replace all Column expressions in a given expression tree with Column expressions provided by the hash map argument.

Scalar function definition for reverse

Rewrite sort on aggregate expressions to sort on the column of aggregate output For example, max(x) is written to col("MAX(x)")

Scalar function definition for right

Unary scalar function definition for round

Scalar function definition for rpad

Scalar function definition for rtrim

Scalar function definition for sha224

Scalar function definition for sha256

Scalar function definition for sha384

Scalar function definition for sha512

Unary scalar function definition for signum

Unary scalar function definition for sin

Scalar function definition for split_part

Unary scalar function definition for sqrt

Scalar function definition for starts_with

Scalar function definition for strpos

Scalar function definition for substr

Create an expression to represent the sum() aggregate function

Unary scalar function definition for tan

Scalar function definition for to_hex

Scalar function definition for translate

Scalar function definition for trim

Unary scalar function definition for trunc

Recursively un-alias an expressions

Union two logical plans with an optional alias.

Recursively ‘unnormalize’ (remove all qualifiers) from an expression tree.

Recursively un-normalize all Column expressions in a list of expression trees

Scalar function definition for upper

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

Type Definitions

A reference-counted reference to a DFSchema.