Module datafusion::physical_expr
source · Expand description
re-export of datafusion_physical_expr
crate
Modules
- Interval and selectivity in
AnalysisContext
- 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
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
- Distribution schemes
- Describes how many rows should be emitted during grouping.
- Partitioning schemes supported by operators.
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.
- Calculates the output orderings for a set of expressions within the context of a given execution plan. The resulting orderings are all in the type of
Column
, since these expressions becomeColumn
after the projection step. The expressions having an alias are renamed with those aliases in the returnedPhysicalSortExpr
’s. If an expression is found to be unordered, the corresponding entry in the output vector isNone
. - This function normalizes
oeq_classes
expressions according toeq_properties
. More explicitly, it makes sure that expressions inoeq_classes
are head entries ineq_properties
, replacing any non-head entries with head entries if necessary. - Normalize the output expressions based on Columns Map.
- Retrieves the ordering equivalence properties for a given schema and output ordering.
- 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.
- Calculates the
SortProperties
of a givenExprOrdering
node. The node is either a leaf node, or an intermediate node:
Type Aliases
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
.