Struct datafusion_python::expr::PyExpr
source · pub struct PyExpr {
pub expr: Expr,
}
Expand description
A PyExpr that can be used on a DataFrame
Fields§
§expr: Expr
Implementations§
source§impl PyExpr
impl PyExpr
pub fn literal(value: ScalarValue) -> PyExpr
pub fn column(value: &str) -> PyExpr
sourcepub fn sort(&self, ascending: bool, nulls_first: bool) -> PyExpr
pub fn sort(&self, ascending: bool, nulls_first: bool) -> PyExpr
Create a sort PyExpr from an existing PyExpr.
pub fn is_null(&self) -> PyExpr
pub fn cast(&self, to: PyArrowType<DataType>) -> PyExpr
sourcepub fn rex_type(&self) -> PyResult<RexType>
pub fn rex_type(&self) -> PyResult<RexType>
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
.
sourcepub fn types(&self) -> PyResult<DataTypeMap>
pub fn types(&self) -> PyResult<DataTypeMap>
Given the current Expr
return the DataTypeMap which represents the
PythonType, Arrow DataType, and SqlType Enum which represents
sourcepub fn python_value(&self, py: Python<'_>) -> PyResult<PyObject>
pub fn python_value(&self, py: Python<'_>) -> PyResult<PyObject>
Extracts the Expr value into a PyObject that can be shared with Python
sourcepub fn rex_call_operands(&self) -> PyResult<Vec<PyExpr>>
pub fn rex_call_operands(&self) -> PyResult<Vec<PyExpr>>
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.
sourcepub fn rex_call_operator(&self) -> PyResult<String>
pub fn rex_call_operator(&self) -> PyResult<String>
Extracts the operator associated with a RexType::Call
pub fn column_name(&self, plan: PyLogicalPlan) -> PyResult<String>
source§impl PyExpr
impl PyExpr
pub fn _column_name( &self, plan: &LogicalPlan ) -> Result<String, DataFusionError>
sourcepub fn expr_to_field(
expr: &Expr,
input_plan: &LogicalPlan
) -> Result<DFField, DataFusionError>
pub fn expr_to_field( expr: &Expr, input_plan: &LogicalPlan ) -> Result<DFField, DataFusionError>
Create a DFField representing an Expr, given an input LogicalPlan to resolve against
Trait Implementations§
source§impl PyClassImpl for PyExpr
impl PyClassImpl for PyExpr
source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = ThreadCheckerStub<PyExpr>
type ThreadChecker = ThreadCheckerStub<PyExpr>
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl PyMethods<PyExpr> for PyClassImplCollector<PyExpr>
impl PyMethods<PyExpr> for PyClassImplCollector<PyExpr>
fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for PyExpr
impl PyTypeInfo for PyExpr
§type AsRefTarget = PyCell<PyExpr>
type AsRefTarget = PyCell<PyExpr>
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
object
is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
object
is an instance of this type.