Expand description
Vortex expression trees and the tooling built on them.
An Expression is a tree of scalar functions over a scope; binding it to a scope’s
DType gives a BoundExpression whose every node carries
its dtype. Expressions are applied to arrays through ArrayExprExt, optimized with each
scalar function’s simplification and reduction rules, and serialized through proto.
Scalar functions themselves and the core builtins live in vortex_array::scalar_fn;
ExprBuiltins and the free constructors in this crate build expressions over them.
Scan planning builds on the tooling here: tree traversal, annotation and labeling
(analysis), normal forms such as conjunct extraction (forms), partitioning and
substitution rewrites (transform), and statistics-based pruning (stats), including
the StatFn scalar function that pruning predicates read statistics through. Call
initialize to register it with a session.
Re-exports§
pub use builtins::ExprBuiltins;pub use analysis::*;pub use lambda::*;pub use scope::*;
Modules§
- analysis
- bound
- Constructors for expressions whose children have already been bound and type-checked.
- builtins
- Expression constructors for the scalar functions vortex-array is built on, as methods.
- display
- forms
- lambda
- Lambdas, the function arguments of higher-order scalar functions such as
list_transform. - proto
- scope
- stats
- Statistics-based pruning: stat expressions, binding them to available statistics, and the falsify/satisfy rewrite rules that turn predicates into pruning predicates.
- transform
- Transformations for
ExpressionandBoundExpressiontrees. - traversal
- Datafusion inspired tree traversal logic.
Structs§
- Exact
Bound Expr - A bound-expression wrapper that compares shared tree identity instead of structure.
Enums§
- Bound
Expression - An expression that has been type-checked against a scope’s root dtype.
- Exact
Identity - What identifies a bound expression to an
ExactKey: the dtype of a root, or the function, dtype and shared children of a scalar node. - Expression
- A node in a Vortex expression tree.
- Weak
Bound Expr Key - A key that identifies a bound expression as
ExactBoundExprdoes, without keeping the expression alive.
Traits§
- Array
Expr Ext - Evaluation of expressions over arrays.
- Exact
Key - A bound expression compared by shared tree identity, as
ExactBoundExprcompares it. - Scalar
FnExpr Ext - Expression constructors for scalar function vtables.
Functions§
- and
- Create a new
Booleanusing theAndoperator. - and_
collect - Collects a list of
anded values into a single expression using a balanced tree. - binary
- Creates the expression
lhs <operator> rhswith the function that owns the operator. - boolean
- Creates a Kleene boolean expression with the given operator.
- cast
- Creates an expression that casts values to a target data type.
- checked_
add - Create a new
Numericusing theAddoperator. - col
- Creates an expression that accesses a field from the root array.
- compare
- Creates a comparison with the given operator.
- eq
- Create a new
Compareusing theEqoperator. - fill_
null - Creates an expression that replaces null values with a fill value.
- get_
item - Creates an expression that extracts a named field from a struct expression.
- gt
- Create a new
Compareusing theGtoperator. - gt_eq
- Create a new
Compareusing theGteoperator. - initialize
- Register the scalar functions this crate defines with the session.
- is_
not_ null - Creates an expression that checks for non-null values.
- is_root
- Return whether the expression is a root expression.
- lit
- Create a new
Literalexpression from a type that coerces toScalar. - lt
- Create a new
Compareusing theLtoperator. - lt_eq
- Create a new
Compareusing theLteoperator. - mask
- Creates a mask expression that applies the given boolean mask to the input array.
- not
- Creates an expression that logically inverts boolean values.
- not_eq
- Create a new
Compareusing theNotEqoperator. - numeric
- Creates an arithmetic expression with the given operator.
- or
- Create a new
Booleanusing theOroperator. - or_
collect - Collects a list of
ored values into a single expression using a balanced tree. - pack
- Creates an expression that packs values into a struct with named fields.
- root
- Creates an expression that references the root scope.
- var
- Creates an expression that reads the parameter
nameof the enclosing lambda.