Module datafusion::logical_plan
source · [−]Expand description
This is a legacy module that only contains re-exports of other modules
Re-exports
pub use crate::datasource::provider_as_source;
pub use crate::datasource::source_as_provider;
pub use crate::execution::FunctionRegistry;
Modules
Expression rewriter
This is a legacy module that only contains re-exports of other modules
This is a legacy module that only contains re-exports of other modules
Structs
A named reference to a qualified field in a schema.
Creates a catalog (aka “Database”).
Creates a schema.
Creates an external table.
Creates an in memory table.
Creates a view.
Apply Cross Join to two logical plans
DFField wraps an Arrow field and adds an optional qualifier
DFSchema wraps an Arrow schema and adds relation names
Drops a table.
Produces no rows: An empty relation with an empty schema
Produces the first n
tuples from its input and discards the rest.
Builder for logical plans
Repartition the plan based on a partitioning scheme.
Represents some sort of execution plan, in String form
Subquery
Produces rows from a table provider by reference or from the context
Union multiple inputs
Values expression. See Postgres VALUES documentation for more details.
Enums
Expr
is a central struct of DataFusion’s query API, and
represent logical expressions such as A + 1
, or CAST(c1 AS int)
.
Types of files to parse as DataFrames
Join constraint
Join type
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.
Operators applied to expressions
Logical partitioning schemes supported by the repartition operator.
Represents which type of plan, when storing multiple for use in EXPLAIN plans
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 certain methods of Expr
(defined in the datafusion-common crate).
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
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
.
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
Trait for something that can be formatted as a stringified plan
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
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
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.
Scalar function definition for concat_expr
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.
Scalar function definition for concat_ws_expr
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
Create an EXISTS subquery expression
Unary scalar function definition for exp
Unary scalar function definition for floor
Create an in_list expression
Create an IN subquery 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 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
Create a NOT EXISTS subquery expression
Create a NOT IN subquery expression
Unary scalar function definition for now
Scalar function definition for now_expr
Unary scalar function definition for nullif
Scalar function definition for octet_length
Return a new expression with a logical OR
Scalar function definition for power
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
Create a scalar subquery expression
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 to_timestamp_micros
Scalar function definition for to_timestamp_millis
Scalar function definition for to_timestamp_seconds
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
.