Skip to main content

Crate vortex_expr

Crate vortex_expr 

Source
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 Expression and BoundExpression trees.
traversal
Datafusion inspired tree traversal logic.

Structs§

ExactBoundExpr
A bound-expression wrapper that compares shared tree identity instead of structure.

Enums§

BoundExpression
An expression that has been type-checked against a scope’s root dtype.
ExactIdentity
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.
WeakBoundExprKey
A key that identifies a bound expression as ExactBoundExpr does, without keeping the expression alive.

Traits§

ArrayExprExt
Evaluation of expressions over arrays.
ExactKey
A bound expression compared by shared tree identity, as ExactBoundExpr compares it.
ScalarFnExprExt
Expression constructors for scalar function vtables.

Functions§

and
Create a new Boolean using the And operator.
and_collect
Collects a list of anded values into a single expression using a balanced tree.
binary
Creates the expression lhs <operator> rhs with 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 Numeric using the Add operator.
col
Creates an expression that accesses a field from the root array.
compare
Creates a comparison with the given operator.
eq
Create a new Compare using the Eq operator.
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 Compare using the Gt operator.
gt_eq
Create a new Compare using the Gte operator.
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 Literal expression from a type that coerces to Scalar.
lt
Create a new Compare using the Lt operator.
lt_eq
Create a new Compare using the Lte operator.
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 Compare using the NotEq operator.
numeric
Creates an arithmetic expression with the given operator.
or
Create a new Boolean using the Or operator.
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 name of the enclosing lambda.