Expand description
re-export of datafusion_expr
crate
Modules§
- aggregate_
doc_ sections - conditional_
expressions - Conditional expressions
- execution_
props - expr
- Logical Expressions:
Expr
- expr_fn
- Functions for creating logical expressions
- expr_
rewriter - Expression rewriter
- expr_
schema - function
- Function module contains typing and signature for built-in and user defined functions.
- groups_
accumulator - interval_
arithmetic - logical_
plan - planner
ContextProvider
andExprPlanner
APIs to customize SQL query planning- registry
- FunctionRegistry trait
- scalar_
doc_ sections - simplify
- Structs and traits to provide the information needed for expression simplification.
- sort_
properties - sqlparser
- SQL Parser for Rust
- statistics
- test
- tree_
node - Tree node implementation for Logical Expressions
- type_
coercion - Type coercion rules for DataFusion
- utils
- Expression utilities
- var_
provider - Variable provider
- window_
doc_ sections - window_
frame - Window frame module
- window_
state - Structures used to hold window function state (for implementing WindowUDFs)
Macros§
Structs§
- Aggregate
- Aggregates its input based on a set of grouping and aggregate expressions (e.g. SUM).
- AggregateUDF
- Logical representation of a user-defined aggregate function (UDAF).
- Analyze
- Runs the actual plan, and then prints the physical plan with with execution metrics.
- Between
- BETWEEN expression
- Binary
Expr - Binary expression
- Case
- CASE expression
- Cast
- Cast expression
- Column
Unnest List - Represent the unnesting operation on a list column, such as the recursion depth and the output column name after unnesting
- Create
Catalog - Creates a catalog (aka “Database”).
- Create
Catalog Schema - Creates a schema.
- Create
External Table - Creates an external table.
- Create
Function - Arguments passed to
CREATE FUNCTION
- Create
Function Body - Create
Index - Create
Memory Table - Creates an in memory table.
- Create
View - Creates a view.
- Deallocate
- Deallocate a prepared statement.
- Describe
Table - Describe the schema of table
- Distinct
On - Removes duplicate rows from the input
- DmlStatement
- The operator that modifies the content of a database (adapted from substrait WriteRel)
- DocSection
- Documentation
- Documentation for use by
ScalarUDFImpl
,AggregateUDFImpl
andWindowUDFImpl
functions. - Documentation
Builder - A builder for
Documentation
’s. - Drop
Catalog Schema - Drops a schema
- Drop
Function - Drop
Table - Drops a table.
- Drop
View - Drops a view.
- Empty
Relation - Produces no rows: An empty relation with an empty schema
- Execute
- Execute a prepared statement.
- Explain
- Produces a relation with string representations of various parts of the plan
- Expr
Func Builder - Implementation of
ExprFunctionExt
. - Extension
- Extension operator defined outside of DataFusion
- Filter
- Filters rows from its input that do not match an expression (essentially a WHERE clause with a predicate expression).
- Join
- Join two logical plans on one or more join columns
- Like
- LIKE expression
- Limit
- Produces the first
n
tuples from its input and discards the rest. - Logical
Plan Builder - Builder for logical plans
- Logical
Plan Builder Options - Options for
LogicalPlanBuilder
- Logical
Table Source - Basic TableSource implementation intended for use in tests and documentation. It is expected that users will provide their own TableSource implementations or use DataFusion’s DefaultTableSource.
- Operate
Function Arg - Prepare
- Prepare a statement but do not execute it. Prepare statements can have 0 or more
Expr::Placeholder
expressions that are filled in during execution - Projection
- Evaluates an arbitrary list of expressions (essentially a SELECT with an expression list) on its input.
- Recursive
Query - A variadic query operation, Recursive CTE.
- Repartition
- Return
Info - Return metadata for this function.
- Return
Type Args - Information about arguments passed to the function
- Scalar
Function Args - Arguments passed to
ScalarUDFImpl::invoke_with_args
when invoking a scalar function. - ScalarUDF
- Logical representation of a Scalar User Defined Function.
- SetVariable
- Set a Variable’s value – value in
ConfigOptions
- Signature
- Defines the supported argument types (
TypeSignature
) andVolatility
for a function. - Simple
AggregateUDF - Implements
AggregateUDFImpl
for functions that have a single signature and return type. - Simple
ScalarUDF - Implements
ScalarUDFImpl
for functions that have a single signature and return type. - Simple
WindowUDF - Implements
WindowUDFImpl
for functions that have a single signature and return type. - Sort
- Sorts its input according to a list of sort expressions.
- Sort
Expr - SORT expression
- Statistics
Args - Arguments passed to
AggregateUDFImpl::value_from_stats
- Stringified
Plan - Represents some sort of execution plan, in String form
- Subquery
- Subquery
- Subquery
Alias - Aliased subquery
- Table
Scan - Produces rows from a table provider by reference or from the context
- Transaction
End - Indicator that any current transaction should be terminated
- Transaction
Start - Indicator that the following statements should be committed or rolled back atomically
- TryCast
- TryCast Expression
- Union
- Union multiple inputs
- Unnest
- Unnest a column that contains a nested list type. See
UnnestOptions
for more details. - Values
- Values expression. See Postgres VALUES documentation for more details.
- Window
- Window its input based on a set of window spec and window function (e.g. SUM or RANK)
- Window
Frame - The frame specification determines which output rows are read by an aggregate
window function. The ending frame boundary can be omitted if the
BETWEEN
andAND
keywords that surround the starting frame boundary are also omitted, in which case the ending frame boundary defaults toCURRENT ROW
. - WindowUDF
- Logical representation of a user-defined window function (UDWF).
Enums§
- Array
Function Argument - Array
Function Signature - Coercion
- Represents type coercion rules for function arguments, specifying both the desired type and optional implicit coercion rules for source types.
- Columnar
Value - The result of evaluating an expression.
- DdlStatement
- Various types of DDL (CREATE / DROP) catalog manipulation
- Distinct
- Removes duplicate rows from the input
- EmitTo
- Describes how many rows should be emitted during grouping.
- Expr
- Represents logical expressions such as
A + 1
, orCAST(c1 AS int)
. - Expr
Func Kind - Fetch
Type - Different types of fetch expression in Limit plan.
- GetField
Access - Access a sub field of a nested type, such as
Field
orList
- Grouping
Set - Grouping sets
- Invariant
Level - Join
Constraint - Join constraint
- Join
Type - Join type
- Logical
Plan - A
LogicalPlan
is a node in a tree of relational operators (such as Projection or Filter). - Operator
- Operators applied to expressions
- Partitioning
- Logical partitioning schemes supported by
LogicalPlan::Repartition
- Plan
Type - Represents which type of plan, when storing multiple for use in EXPLAIN plans
- ReversedUDAF
- ReversedUDWF
- SetMonotonicity
- Indicates whether an aggregation function is monotonic as a set
function. A set function is monotonically increasing if its value
increases as its argument grows (as a set). Formally,
f
is a monotonically increasing set function iff(S) >= f(T)
wheneverS
is a superset ofT
. - Skip
Type - Different types of skip expression in Limit plan.
- Statement
- Various types of Statements.
- Table
Provider Filter Push Down - Indicates how a filter expression is handled by
TableProvider::scan
. - Table
Type - Indicates the type of this table for metadata/catalog purposes.
- Transaction
Access Mode - Indicates if this transaction is allowed to write
- Transaction
Conclusion - Indicates if a transaction was committed or aborted
- Transaction
Isolation Level - Indicates ANSI transaction isolation level
- Type
Signature - A function’s type signature defines the types of arguments the function supports.
- Type
Signature Class - Represents the class of types that can be used in a function signature.
- Volatility
- A function’s volatility, which defines the functions eligibility for certain optimizations
- Window
Frame Bound - There are five ways to describe starting and ending frame boundaries:
- Window
Frame Units - There are three frame types: ROWS, GROUPS, and RANGE. The frame type determines how the starting and ending boundaries of the frame are measured.
- Window
Function Definition - A function used as a SQL window function
- WriteOp
Constants§
- TIMEZONE_
WILDCARD - Constant that is used as a placeholder for any valid timezone.
This is used where a function can accept a timestamp type with any
valid timezone, it exists to avoid the need to enumerate all possible
timezones. See
TypeSignature
for more details. - UNNAMED_
TABLE - Default table name for unnamed table
Traits§
- Accumulator
- Tracks an aggregate function’s state.
- AggregateUDF
Impl - Trait for implementing
AggregateUDF
. - Expr
Function Ext - Extensions for configuring
Expr::AggregateFunction
orExpr::WindowFunction
- Expr
Schemable - Trait to allow expr to typable with respect to a schema
- Groups
Accumulator GroupsAccumulator
implements a single aggregate (e.g. AVG) and stores the state for all groups internally.- Literal
- Trait for converting a type to a
Literal
literal expression. - Partition
Evaluator - Partition evaluator for Window Functions
- ScalarUDF
Impl - Trait for implementing user defined scalar functions.
- Table
Source - Planning time information about a table.
- Timestamp
Literal - Trait for converting a type to a literal timestamp
- ToStringified
Plan - Trait for something that can be formatted as a stringified plan
- User
Defined Logical Node - This defines the interface for
LogicalPlan
nodes that can be used to extend DataFusion with custom relational operators. - User
Defined Logical Node Core - This trait facilitates implementation of the
UserDefinedLogicalNode
. - WindowUDF
Impl - Trait for implementing
WindowUDF
.
Functions§
- and
- Return a new expression with a logical AND
- assert_
expected_ schema - Returns an error if the plan does not have the expected schema. Ignores metadata and nullability.
- binary_
expr - Return a new expression
left <op> right
- bitwise_
and - Return a new expression with bitwise AND
- bitwise_
or - Return a new expression with bitwise OR
- bitwise_
shift_ left - Return a new expression with bitwise SHIFT LEFT
- bitwise_
shift_ right - Return a new expression with bitwise SHIFT RIGHT
- bitwise_
xor - Return a new expression with bitwise XOR
- build_
join_ schema - Creates a schema for a join operation. The fields from the left side are first
- case
- Create a CASE WHEN statement with literal WHEN expressions for comparison to the base expression.
- cast
- Create a cast expression
- check_
subquery_ expr - Do necessary check on subquery expressions and fail the invalid plan
- col
- Create a column expression based on a qualified or unqualified column name. Will normalize unquoted identifiers according to SQL rules (identifiers will become lowercase).
- create_
udaf - Creates a new UDAF with a specific signature, state type and return type.
The signature and state type must match the
Accumulator's implementation
. - create_
udf - Convenience method to create a new user defined scalar function (UDF) with a specific signature and specific return type.
- create_
udwf - Creates a new UDWF with a specific signature, state type and return type.
- cube
- Create a grouping set for all combination of
exprs
- display_
schema - Print the schema in a compact representation to
buf
- exists
- Create an EXISTS subquery expression
- grouping_
set - Create a grouping set
- ident
- Create an unqualified column expression from the provided name, without normalizing the column.
- in_list
- Create an in_list expression
- in_
subquery - Create an IN subquery expression
- interval_
datetime_ lit - interval_
month_ day_ nano_ lit - interval_
year_ month_ lit - is_
false - Create is false expression
- is_
not_ false - Create is not false expression
- is_
not_ true - Create is not true expression
- is_
not_ unknown - Create is not unknown expression
- is_null
- Create is null expression
- is_true
- Create is true expression
- is_
unknown - Create is unknown expression
- lit
- Create a literal expression
- lit_
timestamp_ nano - Create a literal timestamp expression
- not
- Return a new expression with a logical NOT
- not_
exists - Create a NOT EXISTS subquery expression
- not_
in_ subquery - Create a NOT IN subquery expression
- or
- Return a new expression with a logical OR
- out_
ref_ col - Create an out reference column which hold a reference that has been resolved to a field outside of the current plan.
- placeholder
- Create placeholder value that will be filled in (such as
$1
) - projection_
schema - Computes the schema of the result produced by applying a projection to the input logical plan.
- qualified_
wildcard - Create an ‘t.*’
Expr::Wildcard
expression that matches all columns from a specific table - qualified_
wildcard_ with_ options - Create an ‘t.*’
Expr::Wildcard
expression with the wildcard options - rollup
- Create a grouping set for rollup
- scalar_
subquery - Create a scalar subquery expression
- table_
scan - Create a LogicalPlanBuilder representing a scan of a table with the provided name and schema. This is mostly used for testing and documentation.
- try_
cast - Create a try cast expression
- union
- Union two
LogicalPlan
s. - unnest
- Create a Unnest expression
- when
- Create a CASE WHEN statement with boolean WHEN expressions and no base expression.
- wildcard
- Create an ‘*’
Expr::Wildcard
expression that matches all columns - wildcard_
with_ options - Create an ‘*’
Expr::Wildcard
expression with the wildcard options - wrap_
projection_ for_ join_ if_ necessary - Wrap projection for a plan, if the join keys contains normal expression.
Type Aliases§
- Accumulator
Factory Function - Factory that returns an accumulator for the given aggregate function.
- Partition
Evaluator Factory - Factory that creates a PartitionEvaluator for the given window function
- Return
Type Function - Factory that returns the functions’s return type given the input argument types
- Scalar
Function Implementation - Scalar function
- State
Type Function - Factory that returns the types used by an aggregator to serialize its state, given its return datatype.