Module datafusion_physical_expr::expressions
source · Expand description
Defines physical expressions that can evaluated at runtime during query execution
Re-exports
pub use crate::aggregate::build_in::create_aggregate_expr;
pub use crate::PhysicalSortExpr;
Modules
- Module with some convenient methods used in expression building
Structs
- APPROX_DISTINCT aggregate expression
- MEDIAN aggregate expression
- APPROX_PERCENTILE_CONT aggregate expression
- APPROX_PERCENTILE_CONT_WITH_WEIGTH aggregate expression
- ARRAY_AGG aggregate expression
- AVG aggregate expression
- An accumulator to compute the average
- Binary expression
- BIT_AND aggregate expression
- BIT_OR aggregate expression
- BIT_XOR aggregate expression
- BOOL_AND aggregate expression
- BOOL_OR aggregate expression
- The CASE expression is similar to a series of nested if/else and there are two forms that can be used. The first form consists of a series of boolean “when” expressions with corresponding “then” expressions, and an optional “else” expression.
- CAST expression casts an expression to a specific data type and returns a runtime error on invalid cast
- Represents the column at a given index in a RecordBatch
- CORR aggregate expression
- COUNT aggregate expression Returns the amount of non-null values of the given expression.
- COVAR and COVAR_SAMP aggregate expression
- COVAR_POP aggregate expression
- CumeDist calculates the cume_dist in the window function with order by
- Expression for a ARRAY_AGG(DISTINCT) aggregation.
- Expression for a BIT_XOR(DISTINCT) aggregation.
- Expression for a COUNT(DISTINCT) aggregation.
- Expression for a SUM(DISTINCT) aggregation.
- FIRST_VALUE aggregate expression
- Expression to get a field of a struct array.
- GROUPING aggregate expression Returns the amount of non-null values of the given expression.
- InList
- IS NOT NULL expression
- IS NULL expression
- LAST_VALUE aggregate expression
- Represents a literal value
- MAX aggregate expression
- An accumulator to compute the maximum value
- MEDIAN aggregate expression. This uses a lot of memory because all values need to be stored in memory before a result can be computed. If an approximation is sufficient then APPROX_MEDIAN provides a much more efficient solution.
- MIN aggregate expression
- An accumulator to compute the minimum value
- Negative expression
- A place holder expression, can not be evaluated.
- Not expression
- nth_value expression
- Expression for a ARRAY_AGG(ORDER BY) aggregation. When aggregation works in multiple partitions aggregations are split into multiple partitions, then their results are merged. This aggregator is a version of ARRAY_AGG that can support producing intermediate aggregation (with necessary side information) and that can merge aggregations from multiple partitions.
- Rank calculates the rank in the window function with order by
- row_number expression
- STDDEV and STDDEV_SAMP (standard deviation) aggregate expression
- STDDEV_POP population aggregate expression
- SUM aggregate expression
- TRY_CAST expression casts an expression to a specific data type and retuns NULL on invalid cast
- VAR and VAR_SAMP aggregate expression
- VAR_POP aggregate expression
- window shift expression
Enums
- Access a sub field of a nested type, such as
Field
orList
- Enum used for differentiating population and sample for statistical functions
Functions
- Create a binary expression whose arguments are correctly coerced. This function errors if it is not possible to coerce the arguments to computational types supported by the operator.
- Create a CASE expression
- Return a PhysicalExpression representing
expr
casted tocast_type
, if any casting is needed. - Internal cast function for casting ColumnarValue -> ColumnarValue for cast_type
- Return a PhysicalExpression representing
expr
casted tocast_type
, if any casting is needed. - Create a column expression
- Create a cume_dist window function
- Create a dense rank window function
- returns the name of the state
- Creates a unary expression InList
- Create an IS NOT NULL expression
- Create an IS NULL expression
- lag() window function
- lead() window function
- Create a like expression, erroring if the argument types are not compatible.
- Create a literal expression
- Creates a unary expression NEGATIVE
- Creates a unary expression NOT
- Implements NULLIF(expr1, expr2) Args: 0 - left expr is any array 1 - if the left is equal to this expr2, then the result is NULL, otherwise left value is passed.
- Create a percent rank window function
- Create a rank window function
- Return a PhysicalExpression representing
expr
casted tocast_type
, if any casting is needed.