Enum datafusion_expr::Operator
source · pub enum Operator {
Show 27 variants
Eq,
NotEq,
Lt,
LtEq,
Gt,
GtEq,
Plus,
Minus,
Multiply,
Divide,
Modulo,
And,
Or,
IsDistinctFrom,
IsNotDistinctFrom,
RegexMatch,
RegexIMatch,
RegexNotMatch,
RegexNotIMatch,
BitwiseAnd,
BitwiseOr,
BitwiseXor,
BitwiseShiftRight,
BitwiseShiftLeft,
StringConcat,
AtArrow,
ArrowAt,
}
Expand description
Operators applied to expressions
Variants§
Eq
Expressions are equal
NotEq
Expressions are not equal
Lt
Left side is smaller than right side
LtEq
Left side is smaller or equal to right side
Gt
Left side is greater than right side
GtEq
Left side is greater or equal to right side
Plus
Addition
Minus
Subtraction
Multiply
Multiplication operator, like *
Divide
Division operator, like /
Modulo
Remainder operator, like %
And
Logical AND, like &&
Or
Logical OR, like ||
IsDistinctFrom
IS DISTINCT FROM
IsNotDistinctFrom
IS NOT DISTINCT FROM
RegexMatch
Case sensitive regex match
RegexIMatch
Case insensitive regex match
RegexNotMatch
Case sensitive regex not match
RegexNotIMatch
Case insensitive regex not match
BitwiseAnd
Bitwise and, like &
BitwiseOr
Bitwise or, like |
BitwiseXor
Bitwise xor, such as ^
in MySQL or #
in PostgreSQL
BitwiseShiftRight
Bitwise right, like >>
BitwiseShiftLeft
Bitwise left, like <<
StringConcat
String concat
AtArrow
At arrow, like @>
ArrowAt
Arrow at, like <@
Implementations§
source§impl Operator
impl Operator
sourcepub fn negate(&self) -> Option<Operator>
pub fn negate(&self) -> Option<Operator>
If the operator can be negated, return the negated operator otherwise return None
sourcepub fn is_numerical_operators(&self) -> bool
pub fn is_numerical_operators(&self) -> bool
Return true if the operator is a numerical operator.
For example, ‘Binary(a, +, b)’ would be a numerical expression. PostgresSQL concept: https://www.postgresql.org/docs/7.0/operators2198.htm
sourcepub fn is_comparison_operator(&self) -> bool
pub fn is_comparison_operator(&self) -> bool
Return true if the operator is a comparison operator.
For example, ‘Binary(a, >, b)’ would be a comparison expression.
sourcepub fn is_logic_operator(&self) -> bool
pub fn is_logic_operator(&self) -> bool
Return true if the operator is a logic operator.
For example, ‘Binary(Binary(a, >, b), AND, Binary(a, <, b + 3))’ would be a logical expression.
sourcepub fn swap(&self) -> Option<Operator>
pub fn swap(&self) -> Option<Operator>
Return the operator where swapping lhs and rhs wouldn’t change the result.
For example Binary(50, >=, a)
could also be represented as Binary(a, <=, 50)
.
sourcepub fn precedence(&self) -> u8
pub fn precedence(&self) -> u8
Get the operator precedence use https://www.postgresql.org/docs/7.0/operators.htm#AEN2026 as a reference
Trait Implementations§
source§impl PartialEq<Operator> for Operator
impl PartialEq<Operator> for Operator
source§impl PartialOrd<Operator> for Operator
impl PartialOrd<Operator> for Operator
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Operator
impl Eq for Operator
impl StructuralEq for Operator
impl StructuralPartialEq for Operator
Auto Trait Implementations§
impl RefUnwindSafe for Operator
impl Send for Operator
impl Sync for Operator
impl Unpin for Operator
impl UnwindSafe for Operator
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.