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<Arc<Field>, DataFusionError>
pub fn expr_to_field( expr: &Expr, input_plan: &LogicalPlan, ) -> Result<Arc<Field>, DataFusionError>
Create a Field representing an Expr, given an input LogicalPlan to resolve against
Trait Implementations§
source§impl HasPyGilRef for PyExpr
impl HasPyGilRef for PyExpr
§type AsRefTarget = PyCell<PyExpr>
type AsRefTarget = PyCell<PyExpr>
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 = SendablePyClass<PyExpr>
type ThreadChecker = SendablePyClass<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
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
PyTypeInfo::type_object
will be replaced by PyTypeInfo::type_object_bound
in a future PyO3 versionsource§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
PyTypeInfo::is_type_of
will be replaced by PyTypeInfo::is_type_of_bound
in a future PyO3 versionobject
is an instance of this type or a subclass of this type.source§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, 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
PyTypeInfo::is_exact_type_of
will be replaced by PyTypeInfo::is_exact_type_of_bound
in a future PyO3 versionobject
is an instance of this type.impl DerefToPyAny for PyExpr
Auto Trait Implementations§
impl Freeze for PyExpr
impl !RefUnwindSafe for PyExpr
impl Send for PyExpr
impl Sync for PyExpr
impl Unpin for PyExpr
impl !UnwindSafe for PyExpr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more