Expand description
DataFusion is an extensible query execution framework that uses Apache Arrow as its in-memory format.
This crate is a submodule of DataFusion that provides types representing logical query plans (LogicalPlan) and logical expressions (Expr) as well as utilities for working with these types.
The expr_fn module contains functions for creating expressions.
Re-exports§
pub use expr::Between;pub use expr::BinaryExpr;pub use expr::Case;pub use expr::Cast;pub use expr::Expr;pub use expr::GetFieldAccess;pub use expr::GroupingSet;pub use expr::Like;pub use expr::Sort as SortExpr;pub use expr::TryCast;pub use expr::WindowFunctionDefinition;pub use expr_schema::ExprSchemable;pub use function::PartitionEvaluatorFactory;pub use function::ReturnTypeFunction;pub use function::ScalarFunctionImplementation;pub use function::StateTypeFunction;pub use window_frame::WindowFrame;pub use window_frame::WindowFrameBound;pub use window_frame::WindowFrameUnits;pub use sqlparser;pub use expr_fn::*;pub use logical_plan::*;
Modules§
- aggregate_
doc_ sections - arguments
- Argument resolution logic for named function parameters
- async_
udf - binary
- Coercion rules for matching argument types for binary operators
- 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 - literal 🔒
- Literal module contains foundational types that are used to represent literals in DataFusion.
- logical_
plan - operation 🔒
- This module contains implementations of operations (unary, binary etc.) for DataFusion expressions.
- partition_
evaluator 🔒 - Partition evaluation module
- planner
ContextProviderandExprPlannerAPIs to customize SQL query planning- ptr_eq
- registry
- FunctionRegistry trait
- scalar_
doc_ sections - select_
expr - simplify
- Structs and traits to provide the information needed for expression simplification.
- sort_
properties - statistics
- table_
source 🔒 - Table source
- test
- tree_
node - Tree node implementation for Logical Expressions
- type_
coercion - Type coercion rules for DataFusion
- udaf 🔒
AggregateUDF: User Defined Aggregate Functions- udf 🔒
ScalarUDF: Scalar User Defined Functions- udf_eq
- udwf 🔒
WindowUDF: User Defined Window Functions- 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§
- AggregateUDF
- Logical representation of a user-defined aggregate function (UDAF).
- DocSection
- Documentation
- Documentation for use by
ScalarUDFImpl,AggregateUDFImplandWindowUDFImplfunctions. - Documentation
Builder - A builder for
Documentation’s. - Return
Field Args - Information about arguments passed to the function
- Scalar
Function Args - Arguments passed to
ScalarUDFImpl::invoke_with_argswhen invoking a scalar function. - Scalar
Function Lambda Arg - A lambda argument to a ScalarFunction
- ScalarUDF
- Logical representation of a Scalar User Defined Function.
- Signature
- Provides information necessary for calling a function.
- Statistics
Args - Arguments passed to
AggregateUDFImpl::value_from_stats - 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.
- EmitTo
- Describes how many rows should be emitted during grouping.
- Limit
Effect - the effect this function will have on the limit pushdown
- Operator
- Operators applied to expressions
- 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,
fis a monotonically increasing set function iff(S) >= f(T)wheneverSis a superset ofT. - 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.
- Type
Signature - The types of arguments for which a function has implementations.
- Type
Signature Class - Represents the class of types that can be used in a function signature.
- Value
OrLambda - Value
OrLambda Field - A tagged Field indicating whether it correspond to a value or a lambda argument
- Value
OrLambda Parameter - Volatility
- How a function’s output changes with respect to a fixed input
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
TypeSignaturefor more details.
Traits§
- Accumulator
- Tracks an aggregate function’s state.
- AggregateUDF
Impl - Trait for implementing
AggregateUDF. - Groups
Accumulator GroupsAccumulatorimplements a single aggregate (e.g. AVG) and stores the state for all groups internally.- Literal
- Trait for converting a type to a
Literalliteral 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
- WindowUDF
Impl - Trait for implementing
WindowUDF.
Functions§
- lit
- Create a literal expression
- lit_
timestamp_ nano - Create a literal timestamp expression
- lit_
with_ metadata - merge_
captures_ with_ args - Merge the lambda body captured columns with it’s arguments Datafusion relies on an unspecified field ordering implemented in this function As such, this is the only correct way to merge the captured values with the arguments The number of args should not be lower than the number of params
- merge_
captures_ with_ boxed_ lazy_ args - Variation of merge_captures_with_lazy_args that take boxed closures
- merge_
captures_ with_ lazy_ args - Lazy version of merge_captures_with_args that receives closures to compute the arguments, and calls only the necessary to match the number of params
- udaf_
default_ display_ name - Encapsulates default implementation of
AggregateUDFImpl::display_name. - udaf_
default_ human_ display - Encapsulates default implementation of
AggregateUDFImpl::human_display. - udaf_
default_ return_ field - Encapsulates default implementation of
AggregateUDFImpl::return_field. - udaf_
default_ schema_ name - Encapsulates default implementation of
AggregateUDFImpl::schema_name. - udaf_
default_ window_ function_ display_ name - Encapsulates default implementation of
AggregateUDFImpl::window_function_display_name. - udaf_
default_ window_ function_ schema_ name - Encapsulates default implementation of
AggregateUDFImpl::window_function_schema_name.
Type Aliases§
- Accumulator
Factory Function - Factory that returns an accumulator for the given aggregate function.