pub enum AExpr {
Show 17 variants
Explode(Node),
Alias(Node, PlSmallStr),
Column(PlSmallStr),
Literal(LiteralValue),
BinaryExpr {
left: Node,
op: Operator,
right: Node,
},
Cast {
expr: Node,
dtype: DataType,
options: CastOptions,
},
Sort {
expr: Node,
options: SortOptions,
},
Gather {
expr: Node,
idx: Node,
returns_scalar: bool,
},
SortBy {
expr: Node,
by: Vec<Node>,
sort_options: SortMultipleOptions,
},
Filter {
input: Node,
by: Node,
},
Agg(IRAggExpr),
Ternary {
predicate: Node,
truthy: Node,
falsy: Node,
},
AnonymousFunction {
input: Vec<ExprIR>,
function: OpaqueColumnUdf,
output_type: GetOutput,
options: FunctionOptions,
},
Function {
input: Vec<ExprIR>,
function: FunctionExpr,
options: FunctionOptions,
},
Window {
function: Node,
partition_by: Vec<Node>,
order_by: Option<(Node, SortOptions)>,
options: WindowType,
},
Slice {
input: Node,
offset: Node,
length: Node,
},
Len,
}
Expand description
IR expression node that is allocated in an Arena
.
Variants§
Explode(Node)
Alias(Node, PlSmallStr)
Column(PlSmallStr)
Literal(LiteralValue)
BinaryExpr
Cast
Sort
Gather
SortBy
Filter
Agg(IRAggExpr)
Ternary
AnonymousFunction
Function
Fields
§
input: Vec<ExprIR>
Function arguments
Some functions rely on aliases,
for instance assignment of struct fields.
Therefor we need [ExprIr
].
§
function: FunctionExpr
function to apply
§
options: FunctionOptions
Window
Slice
Len
Implementations§
Source§impl AExpr
impl AExpr
pub fn to_dtype( &self, schema: &Schema, ctx: Context, arena: &Arena<AExpr>, ) -> PolarsResult<DataType>
Sourcepub fn to_field(
&self,
schema: &Schema,
ctx: Context,
arena: &Arena<AExpr>,
) -> PolarsResult<Field>
pub fn to_field( &self, schema: &Schema, ctx: Context, arena: &Arena<AExpr>, ) -> PolarsResult<Field>
Get Field result of the expression. The schema is the input data.
Sourcepub fn to_field_and_validate(
&self,
schema: &Schema,
ctx: Context,
arena: &Arena<AExpr>,
) -> PolarsResult<Field>
pub fn to_field_and_validate( &self, schema: &Schema, ctx: Context, arena: &Arena<AExpr>, ) -> PolarsResult<Field>
Get Field result of the expression. The schema is the input data.
Sourcepub fn to_field_impl(
&self,
ctx: &mut ToFieldContext<'_>,
agg_list: &mut bool,
) -> PolarsResult<Field>
pub fn to_field_impl( &self, ctx: &mut ToFieldContext<'_>, agg_list: &mut bool, ) -> PolarsResult<Field>
Get Field result of the expression. The schema is the input data.
This is taken as &mut bool
as for some expressions this is determined by the upper node
(e.g. alias
, cast
).
Source§impl AExpr
impl AExpr
Sourcepub fn inputs_rev<E>(&self, container: &mut E)
pub fn inputs_rev<E>(&self, container: &mut E)
Push the inputs of this node to the given container, in reverse order. This ensures the primary node responsible for the name is pushed last.
pub fn replace_inputs(self, inputs: &[Node]) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AExpr
impl<'de> Deserialize<'de> for AExpr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for AExpr
impl !RefUnwindSafe for AExpr
impl Send for AExpr
impl Sync for AExpr
impl Unpin for AExpr
impl !UnwindSafe for AExpr
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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