pub enum Expr {
Column {
path: Vec<String>,
},
Literal {
value: ScalarValue,
},
Alias {
expression: Box<Expr>,
name: String,
},
Binary {
left: Box<Expr>,
op: BinaryOperator,
right: Box<Expr>,
},
IsNull {
expression: Box<Expr>,
negated: bool,
},
Aggregate {
function: AggregateFunction,
expression: Option<Box<Expr>>,
distinct: bool,
},
Cast {
expression: Box<Expr>,
data_type: ExprDataType,
safe: bool,
},
Sort {
expression: Box<Expr>,
direction: SortDirection,
nulls: NullOrdering,
},
Function {
name: String,
arguments: Vec<Expr>,
},
Window {
expression: Box<Expr>,
partition_by: Vec<Expr>,
order_by: Vec<Expr>,
frame: Option<WindowFrame>,
},
RawSql {
sql: String,
},
}Expand description
Structured public expression AST.
Variants§
Column
Literal
Fields
§
value: ScalarValueAlias
Binary
IsNull
Aggregate
Cast
Sort
Function
Window
Fields
§
frame: Option<WindowFrame>ROWS/RANGE BETWEEN ... AND ... frame bounds. #[serde(default)]
so expressions serialized before this field existed still decode
(as “no frame specified”, DataFusion’s own OVER-clause default).
RawSql
Implementations§
Source§impl Expr
impl Expr
pub fn column(name: &str) -> Self
pub fn literal(value: ScalarValue) -> Self
pub fn raw(sql: impl Into<String>) -> Self
pub fn alias(self, name: impl Into<String>) -> Self
pub fn binary(self, op: BinaryOperator, right: Expr) -> Self
pub fn cast(self, data_type: ExprDataType) -> Self
pub fn try_cast(self, data_type: ExprDataType) -> Self
pub fn function(name: impl Into<String>, arguments: Vec<Expr>) -> Self
pub fn over(self, partition_by: Vec<Expr>, order_by: Vec<Expr>) -> Self
Sourcepub fn frame(self, frame: WindowFrame) -> Self
pub fn frame(self, frame: WindowFrame) -> Self
Attach a ROWS/RANGE BETWEEN ... AND ... frame to a window
expression built by Expr::over. A no-op on any other variant —
there is no frame to attach without a preceding .over(...) call.
pub fn normalize_json(&self) -> Result<String, PlanError>
pub fn encode_versioned(&self) -> Result<Vec<u8>, PlanError>
pub fn decode_versioned(bytes: &[u8]) -> Result<Self, PlanError>
pub fn validate(&self) -> Result<(), PlanError>
pub fn to_sql(&self) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
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
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request