Module datafusion::physical_expr
source · Expand description
re-export of datafusion_physical_expr
crate
Modules
- Array expressions
- Crypto expressions
- DateTime expressions
- Encoding expressions
- Defines physical expressions that can evaluated at runtime during query execution
- Declaration of built-in (scalar) functions. This module contains built-in functions’ enumeration and metadata.
- Functionality used both on logical and physical plans
- Interval arithmetic and constraint propagation library
- Math expressions
- Regex expressions
- String expressions
- Struct expressions
- This module provides common traits for visiting or rewriting tree nodes easily.
- UDF support
- Unicode expressions
- Variable provider
Macros
- The binary_array_op macro includes types that extend beyond the primitive, such as Utf8 strings.
- The binary_array_op_dyn_scalar macro includes types that extend beyond the primitive, such as Utf8 strings.
Structs
- The shared context used during the analysis of an expression. Includes the boundaries for all known columns.
- Represents a collection of
EquivalentClass
(equivalences between columns in relations) - EquivalentClass is a set of
Column
s orPhysicalSortExpr
s that are known to have the same value in all tuples in a relation.EquivalentClass<Column>
is generated by equality predicates, typically equijoin conditions and equality conditions in filters.EquivalentClass<PhysicalSortExpr>
is generated by theROW_NUMBER
window function. - Represents the boundaries of the resulting value from a physical expression, if it were to be an expression, if it were to be evaluated.
- An adapter that implements
GroupsAccumulator
for anyAccumulator
- Represents Sort operation for a column in a RecordBatch
- Represents sort requirement associated with a plan
- Physical expression of a scalar function
Enums
- Describes how many rows should be emitted during grouping.
Traits
- An aggregate expression that:
GroupAccumulator
implements a single aggregate (e.g. AVG) and stores the state for all groups internally.- Expression that can be evaluated against a RecordBatch A Physical expression knows its type, nullability and how to evaluate itself.
Functions
- Attempts to refine column boundaries and compute a selectivity value.
- Create a physical expression from a logical expression (Expr).
- Compare the two expr lists are equal no matter the order. For example two InListExpr can be considered to be equals no matter the order:
- Strictly compare the two expr lists are equal in the given order.
- Normalize the output expressions based on Columns Map.
- This function applies the given projection to the given equivalence properties to compute the resulting (projected) equivalence properties; e.g.
- This function applies the given projection to the given ordering equivalence properties to compute the resulting (projected) ordering equivalence properties; e.g.
- Reverses the ORDER BY expression, which is useful during equivalent window expression construction. For instance, ‘ORDER BY a ASC, NULLS LAST’ turns into ‘ORDER BY a DESC, NULLS FIRST’.
- Assume the predicate is in the form of CNF, split the predicate to a Vec of PhysicalExprs.
Type Definitions
LexOrdering
is a type alias for lexicographical ordering definitionVec<PhysicalSortExpr>
LexOrderingRef
is a type alias for lexicographical ordering reference &[PhysicalSortExpr]
LexOrderingReq
is a type alias for lexicographical ordering requirement definitionVec<PhysicalSortRequirement>
OrderingEquivalenceProperties
keeps track of columns that describe the global ordering of the schema. These columns are not necessarily same; e.g.LexOrdering
stores the lexicographical ordering for a schema. OrderingEquivalentClass keeps track of different alternative orderings than can describe the schema. For instance, for the table below |a|b|c|d| |1|4|3|1| |2|3|3|2| |3|1|2|2| |3|2|1|3| bothvec![a ASC, b ASC]
andvec![c DESC, d ASC]
describe the ordering of the table. For this case, we say thatvec![a ASC, b ASC]
, andvec![c DESC, d ASC]
are ordering equivalent.- Shared
PhysicalExpr
.