Skip to main content

Expr

Type Alias Expr 

Source
pub type Expr = Expr;

Aliased Type§

pub enum Expr {
Show 27 variants Element, Alias(Arc<Expr>, PlSmallStr), Column(PlSmallStr), Selector(Selector), Literal(LiteralValue), DataTypeFunction(DataTypeFunction), BinaryExpr { left: Arc<Expr>, op: Operator, right: Arc<Expr>, }, Cast { expr: Arc<Expr>, dtype: DataTypeExpr, options: CastOptions, }, Sort { expr: Arc<Expr>, options: SortOptions, }, Gather { expr: Arc<Expr>, idx: Arc<Expr>, returns_scalar: bool, null_on_oob: bool, }, SortBy { expr: Arc<Expr>, by: Vec<Expr>, sort_options: SortMultipleOptions, }, Agg(AggExpr), Ternary { predicate: Arc<Expr>, truthy: Arc<Expr>, falsy: Arc<Expr>, }, Function { input: Vec<Expr>, function: FunctionExpr, }, Explode { input: Arc<Expr>, options: ExplodeOptions, }, Filter { input: Arc<Expr>, by: Arc<Expr>, }, Over { function: Arc<Expr>, partition_by: Vec<Expr>, order_by: Option<(Arc<Expr>, SortOptions)>, mapping: WindowMapping, }, Slice { input: Arc<Expr>, offset: Arc<Expr>, length: Arc<Expr>, }, KeepName(Arc<Expr>), Len, Field(Arc<[PlSmallStr]>), AnonymousFunction { input: Vec<Expr>, function: LazySerde<SpecialEq<Arc<dyn AnonymousColumnsUdf>>>, options: FunctionOptions, fmt_str: Box<PlSmallStr>, }, Eval { expr: Arc<Expr>, evaluation: Arc<Expr>, variant: EvalVariant, }, StructEval { expr: Arc<Expr>, evaluation: Vec<Expr>, }, SubPlan(SpecialEq<Arc<DslPlan>>, Vec<(PlSmallStr, Expr)>), RenameAlias { function: RenameAliasFn, expr: Arc<Expr>, }, Display { inputs: Vec<Expr>, fmt_str: Box<PlSmallStr>, },
}

Variants§

§

Element

Values in a eval context.

Equivalent of pl.element().

§

Alias(Arc<Expr>, PlSmallStr)

§

Column(PlSmallStr)

§

Selector(Selector)

§

Literal(LiteralValue)

§

DataTypeFunction(DataTypeFunction)

§

BinaryExpr

Fields

§left: Arc<Expr>
§right: Arc<Expr>
§

Cast

Fields

§expr: Arc<Expr>
§options: CastOptions
§

Sort

Fields

§expr: Arc<Expr>
§options: SortOptions
§

Gather

Fields

§expr: Arc<Expr>
§idx: Arc<Expr>
§returns_scalar: bool
§null_on_oob: bool
§

SortBy

Fields

§expr: Arc<Expr>
§by: Vec<Expr>
§sort_options: SortMultipleOptions
§

Agg(AggExpr)

§

Ternary

A ternary operation if true then “foo” else “bar”

Fields

§predicate: Arc<Expr>
§truthy: Arc<Expr>
§falsy: Arc<Expr>
§

Function

Fields

§input: Vec<Expr>

function arguments

§function: FunctionExpr

function to apply

§

Explode

Fields

§input: Arc<Expr>
§

Filter

Fields

§input: Arc<Expr>
§by: Arc<Expr>
§

Over

Polars flavored window functions.

Fields

§function: Arc<Expr>

Also has the input. i.e. avg(“foo”)

§partition_by: Vec<Expr>
§order_by: Option<(Arc<Expr>, SortOptions)>
§

Slice

Fields

§input: Arc<Expr>
§offset: Arc<Expr>

length is not yet known so we accept negative offsets

§length: Arc<Expr>
§

KeepName(Arc<Expr>)

Set root name as Alias

§

Len

§

Field(Arc<[PlSmallStr]>)

§

AnonymousFunction

Fields

§input: Vec<Expr>

function arguments

§function: LazySerde<SpecialEq<Arc<dyn AnonymousColumnsUdf>>>

function to apply

§fmt_str: Box<PlSmallStr>

used for formatting

§

Eval

Evaluates the evaluation expression on the output of the expr.

Consequently, expr is an input and evaluation is not and needs a different schema.

Fields

§expr: Arc<Expr>
§evaluation: Arc<Expr>
§variant: EvalVariant
§

StructEval

Evaluates the evaluation expressions on the output of the expr.

Consequently, expr is an input and evaluation uses an extended schema that includes this input.

Fields

§expr: Arc<Expr>
§evaluation: Vec<Expr>
§

SubPlan(SpecialEq<Arc<DslPlan>>, Vec<(PlSmallStr, Expr)>)

SQL SubQueries Plan, Post-select expression and output-name of that expr

§

RenameAlias

Fields

§function: RenameAliasFn
§expr: Arc<Expr>
§

Display

Not a real expression. This is meant as catch-all for IR expressions that are not supported by DSL.

Fields

§inputs: Vec<Expr>
§fmt_str: Box<PlSmallStr>