UnnestExpr#
- class ray.data.expressions.UnnestExpr(expr: Expr)[source]#
Bases:
ExprExpression that expands a struct-typed expression into one output column per struct field.
This is a plan-time marker, analogous to
StarExpr: it never survives into the optimizer or the evaluation engine.Project.__post_init__eagerly desugars it (viaexpand_projection) into oneexpr.struct.field_by_index(i).alias(field_name)projection entry per struct field, so downstream code only ever sees ordinary named expressions. The struct field names and order come from the expression’s resolved PyArrow struct type;CommonSubExprEliminationthen deduplicates the shared inner subtree so it is evaluated once per block.Because desugaring needs the struct type at plan time, the wrapped expression must either carry a declared struct
return_dtype(UDFs) or reference a struct column resolvable from the input schema. OtherwiseProjectconstruction raises.See
unnest()for the public constructor.DeveloperAPI: This API may change across minor Ray releases.
Methods
Compute the absolute value of the expression.
Compute the arccosine (inverse cosine) of the expression, returning radians.
Compute the arcsine (inverse sine) of the expression, returning radians.
Compute the arctangent (inverse tangent) of the expression, returning radians.
Cast the expression to a specified type.
Round values up to the nearest integer.
Compute the cosine of the expression (in radians).
Compute the natural exponential of the expression.
Desugar into one aliased struct-field access per struct field.
Round values down to the nearest integer.
Resolve the output PyArrow data type given the input schema.
Return whether this expression is safe to duplicate, reorder, or move.
Check if the expression value is in a list of values.
Check if the expression value is not null.
Check if the expression value is null.
Compute the natural logarithm of the expression.
Compute the base-10 logarithm of the expression.
Compute the base-2 logarithm of the expression.
Compute the negation of the expression.
Check if the expression value is not in a list of values.
Whether the output of this expression may contain nulls.
Raise the expression to the given power.
Round values to the nearest integer using PyArrow semantics.
Compute the sign of the expression.
Compute the sine of the expression (in radians).
Compute the tangent of the expression (in radians).
Convert this Ray Data expression to a PyArrow compute expression.
Truncate fractional values toward zero.
Attributes
Access array operations for this expression.
Access datetime operations for this expression.
Access list operations for this expression.
Access map/dict operations for this expression.
Get the name associated with this expression.
Access string operations for this expression.
Access struct operations for this expression.
The wrapped expression; must resolve to a PyArrow struct type.