Module datafusion_expr

Source
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 and ExprPlanner APIs to customize SQL query planning
registry
FunctionRegistry trait
scalar_doc_sections
select_expr
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§

expr_vec_fmt

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
BinaryExpr
Binary expression
Case
CASE expression
Cast
Cast expression
ColumnUnnestList
Represent the unnesting operation on a list column, such as the recursion depth and the output column name after unnesting
CreateCatalog
Creates a catalog (aka “Database”).
CreateCatalogSchema
Creates a schema.
CreateExternalTable
Creates an external table.
CreateFunction
Arguments passed to CREATE FUNCTION
CreateFunctionBody
CreateIndex
CreateMemoryTable
Creates an in memory table.
CreateView
Creates a view.
Deallocate
Deallocate a prepared statement.
DescribeTable
Describe the schema of table
DistinctOn
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 and WindowUDFImpl functions.
DocumentationBuilder
A builder for Documentation’s.
DropCatalogSchema
Drops a schema
DropFunction
DropTable
Drops a table.
DropView
Drops a view.
EmptyRelation
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
ExprFuncBuilder
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.
LogicalPlanBuilder
Builder for logical plans
LogicalPlanBuilderOptions
Options for LogicalPlanBuilder
LogicalTableSource
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.
OperateFunctionArg
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.
RecursiveQuery
A variadic query operation, Recursive CTE.
Repartition
ReturnInfo
Return metadata for this function.
ReturnTypeArgs
Information about arguments passed to the function
ScalarFunctionArgs
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) and Volatility for a function.
SimpleAggregateUDF
Implements AggregateUDFImpl for functions that have a single signature and return type.
SimpleScalarUDF
Implements ScalarUDFImpl for functions that have a single signature and return type.
SimpleWindowUDF
Implements WindowUDFImpl for functions that have a single signature and return type.
Sort
Sorts its input according to a list of sort expressions.
SortExpr
SORT expression
StatisticsArgs
Arguments passed to AggregateUDFImpl::value_from_stats
StringifiedPlan
Represents some sort of execution plan, in String form
Subquery
Subquery
SubqueryAlias
Aliased subquery
TableScan
Produces rows from a table provider by reference or from the context
TransactionEnd
Indicator that any current transaction should be terminated
TransactionStart
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)
WindowFrame
The frame specification determines which output rows are read by an aggregate window function. The ending frame boundary can be omitted if the BETWEEN and AND keywords that surround the starting frame boundary are also omitted, in which case the ending frame boundary defaults to CURRENT ROW.
WindowUDF
Logical representation of a user-defined window function (UDWF).

Enums§

ArrayFunctionArgument
ArrayFunctionSignature
Coercion
Represents type coercion rules for function arguments, specifying both the desired type and optional implicit coercion rules for source types.
ColumnarValue
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.
ExplainFormat
Output formats for controlling for Explain plans
Expr
Represents logical expressions such as A + 1, or CAST(c1 AS int).
ExprFuncKind
FetchType
Different types of fetch expression in Limit plan.
GetFieldAccess
Access a sub field of a nested type, such as Field or List
GroupingSet
Grouping sets
InvariantLevel
JoinConstraint
Join constraint
JoinType
Join type
LogicalPlan
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
PlanType
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 if f(S) >= f(T) whenever S is a superset of T.
SkipType
Different types of skip expression in Limit plan.
Statement
Various types of Statements.
TableProviderFilterPushDown
Indicates how a filter expression is handled by TableProvider::scan.
TableType
Indicates the type of this table for metadata/catalog purposes.
TransactionAccessMode
Indicates if this transaction is allowed to write
TransactionConclusion
Indicates if a transaction was committed or aborted
TransactionIsolationLevel
Indicates ANSI transaction isolation level
TypeSignature
A function’s type signature defines the types of arguments the function supports.
TypeSignatureClass
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
WindowFrameBound
There are five ways to describe starting and ending frame boundaries:
WindowFrameUnits
There are three frame types: ROWS, GROUPS, and RANGE. The frame type determines how the starting and ending boundaries of the frame are measured.
WindowFunctionDefinition
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.
AggregateUDFImpl
Trait for implementing AggregateUDF.
ExprFunctionExt
Extensions for configuring Expr::AggregateFunction or Expr::WindowFunction
ExprSchemable
Trait to allow expr to typable with respect to a schema
GroupsAccumulator
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.
PartitionEvaluator
Partition evaluator for Window Functions
ScalarUDFImpl
Trait for implementing user defined scalar functions.
TableSource
Planning time information about a table.
TimestampLiteral
Trait for converting a type to a literal timestamp
ToStringifiedPlan
Trait for something that can be formatted as a stringified plan
UserDefinedLogicalNode
This defines the interface for LogicalPlan nodes that can be used to extend DataFusion with custom relational operators.
UserDefinedLogicalNodeCore
This trait facilitates implementation of the UserDefinedLogicalNode.
WindowUDFImpl
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 LogicalPlans.
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§

AccumulatorFactoryFunction
Factory that returns an accumulator for the given aggregate function.
PartitionEvaluatorFactory
Factory that creates a PartitionEvaluator for the given window function
ReturnTypeFunction
Factory that returns the functions’s return type given the input argument types
ScalarFunctionImplementation
Scalar function
StateTypeFunction
Factory that returns the types used by an aggregator to serialize its state, given its return datatype.