[][src]Enum datafusion::logicalplan::Expr

pub enum Expr {
    Column(usize),
    Literal(ScalarValue),
    BinaryExpr {
        left: Arc<Expr>,
        op: Operator,
        right: Arc<Expr>,
    },
    IsNotNull(Arc<Expr>),
    IsNull(Arc<Expr>),
    Cast {
        expr: Arc<Expr>,
        data_type: DataType,
    },
    Sort {
        expr: Arc<Expr>,
        asc: bool,
    },
    ScalarFunction {
        name: String,
        args: Vec<Expr>,
        return_type: DataType,
    },
    AggregateFunction {
        name: String,
        args: Vec<Expr>,
        return_type: DataType,
    },
}

Relation expression

Variants

Column(usize)

index into a value within the row or complex value

Literal(ScalarValue)

literal value

BinaryExpr

binary expression e.g. "age > 21"

Fields of BinaryExpr

left: Arc<Expr>

Left-hand side of the expression

op: Operator

The comparison operator

right: Arc<Expr>

Right-hand side of the expression

IsNotNull(Arc<Expr>)

unary IS NOT NULL

IsNull(Arc<Expr>)

unary IS NULL

Cast

cast a value to a different type

Fields of Cast

expr: Arc<Expr>

The expression being cast

data_type: DataType

The DataType the expression will yield

Sort

sort expression

Fields of Sort

expr: Arc<Expr>

The expression to sort on

asc: bool

The direction of the sort

ScalarFunction

scalar function

Fields of ScalarFunction

name: String

Name of the function

args: Vec<Expr>

List of expressions to feed to the functions as arguments

return_type: DataType

The DataType the expression will yield

AggregateFunction

aggregate function

Fields of AggregateFunction

name: String

Name of the function

args: Vec<Expr>

List of expressions to feed to the functions as arguments

return_type: DataType

The DataType the expression will yield

Methods

impl Expr[src]

pub fn get_type(&self, schema: &Schema) -> DataType[src]

Find the DataType for the expression

pub fn cast_to(&self, cast_to_type: &DataType, schema: &Schema) -> Result<Expr>[src]

Perform a type cast on the expression value.

Will Err if the type cast cannot be performed.

pub fn eq(&self, other: &Expr) -> Expr[src]

Equal

pub fn not_eq(&self, other: &Expr) -> Expr[src]

Not equal

pub fn gt(&self, other: &Expr) -> Expr[src]

Greater than

pub fn gt_eq(&self, other: &Expr) -> Expr[src]

Greater than or equal to

pub fn lt(&self, other: &Expr) -> Expr[src]

Less than

pub fn lt_eq(&self, other: &Expr) -> Expr[src]

Less than or equal to

Trait Implementations

impl Clone for Expr[src]

impl Debug for Expr[src]

impl PartialEq<Expr> for Expr[src]

impl StructuralPartialEq for Expr[src]

Auto Trait Implementations

impl RefUnwindSafe for Expr

impl Send for Expr

impl Sync for Expr

impl Unpin for Expr

impl UnwindSafe for Expr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> From<T> for T[src]

impl<T> FromCast<T> for T

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err