datafusion.Expr¶
- class datafusion.Expr¶
Bases:
object
A PyExpr that can be used on a DataFrame
- __init__()¶
Methods
__init__
()alias
(name)assign a name to the PyExpr
Returns a full and complete string representation of this expression.
cast
(to)column
(value)column_name
(plan)Returns the name of this expression as it should appear in a schema.
is_null
()literal
(value)Extracts the Expr value into a PyObject that can be shared with Python
Row expressions, Rex(s), operate on the concept of operands.
Extracts the operator associated with a RexType::Call
rex_type
()A Rex (Row Expression) specifies a single row of data.
sort
([ascending, nulls_first])Create a sort PyExpr from an existing PyExpr.
Return the specific expression
types
()Given the current Expr return the DataTypeMap which represents the PythonType, Arrow DataType, and SqlType Enum which represents
Returns the name of the Expr variant.
- alias(name)¶
assign a name to the PyExpr
- canonical_name()¶
Returns a full and complete string representation of this expression.
- cast(to)¶
- static column(value)¶
- column_name(plan)¶
- display_name()¶
Returns the name of this expression as it should appear in a schema. This name will not include any CAST expressions.
- is_null()¶
- static literal(value)¶
- python_value()¶
Extracts the Expr value into a PyObject that can be shared with Python
- rex_call_operands()¶
Row expressions, Rex(s), operate on the concept of operands. Different variants of Expressions, Expr(s), store those operands in different datastructures. This function examines the Expr variant and returns the operands to the calling logic as a Vec of PyExpr instances.
- rex_call_operator()¶
Extracts the operator associated with a RexType::Call
- rex_type()¶
A Rex (Row Expression) specifies a single row of data. That specification could include user defined functions or types. RexType identifies the row as one of the possible valid RexTypes.
- sort(ascending=True, nulls_first=True)¶
Create a sort PyExpr from an existing PyExpr.
- to_variant()¶
Return the specific expression
- types()¶
Given the current Expr return the DataTypeMap which represents the PythonType, Arrow DataType, and SqlType Enum which represents
- variant_name()¶
Returns the name of the Expr variant. Ex: ‘IsNotNull’, ‘Literal’, ‘BinaryExpr’, etc