MCPcopy Create free account
hub / github.com/apache/datafusion / apply_operator

Function apply_operator

datafusion/expr-common/src/interval_arithmetic.rs:1046–1062  ·  view source on GitHub ↗

Applies the given binary operator the `lhs` and `rhs` arguments.

(op: &Operator, lhs: &Interval, rhs: &Interval)

Source from the content-addressed store, hash-verified

1044
1045/// Applies the given binary operator the `lhs` and `rhs` arguments.
1046pub fn apply_operator(op: &Operator, lhs: &Interval, rhs: &Interval) -> Result<Interval> {
1047 match *op {
1048 Operator::Eq => lhs.equal(rhs),
1049 Operator::NotEq => lhs.equal(rhs)?.not(),
1050 Operator::Gt => lhs.gt(rhs),
1051 Operator::GtEq => lhs.gt_eq(rhs),
1052 Operator::Lt => lhs.lt(rhs),
1053 Operator::LtEq => lhs.lt_eq(rhs),
1054 Operator::And => lhs.and(rhs),
1055 Operator::Or => lhs.or(rhs),
1056 Operator::Plus => lhs.add(rhs),
1057 Operator::Minus => lhs.sub(rhs),
1058 Operator::Multiply => lhs.mul(rhs),
1059 Operator::Divide => lhs.div(rhs),
1060 _ => internal_err!("Interval arithmetic does not support the operator {op}"),
1061 }
1062}
1063
1064/// Helper function used for adding the end-point values of intervals.
1065///

Callers 8

evaluate_boundsMethod · 0.85
propagate_arithmeticFunction · 0.85
propagate_rightFunction · 0.85
apply_operatorMethod · 0.85

Calls 12

equalMethod · 0.80
notMethod · 0.45
gtMethod · 0.45
gt_eqMethod · 0.45
ltMethod · 0.45
lt_eqMethod · 0.45
andMethod · 0.45
orMethod · 0.45
addMethod · 0.45
subMethod · 0.45
mulMethod · 0.45
divMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…