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

Method or

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

Compute the logical disjunction of this boolean interval with the given boolean interval.

(&self, other: T)

Source from the content-addressed store, hash-verified

605 /// Compute the logical disjunction of this boolean interval with the
606 /// given boolean interval.
607 pub fn or<T: Borrow<Self>>(&self, other: T) -> Result<Self> {
608 let rhs = other.borrow();
609 match (&self.lower, &self.upper, &rhs.lower, &rhs.upper) {
610 (
611 &ScalarValue::Boolean(Some(self_lower)),
612 &ScalarValue::Boolean(Some(self_upper)),
613 &ScalarValue::Boolean(Some(other_lower)),
614 &ScalarValue::Boolean(Some(other_upper)),
615 ) => {
616 let lower = self_lower || other_lower;
617 let upper = self_upper || other_upper;
618
619 Ok(Self {
620 lower: ScalarValue::Boolean(Some(lower)),
621 upper: ScalarValue::Boolean(Some(upper)),
622 })
623 }
624
625 // Return TRUE_OR_FALSE when intervals don't have concrete boolean bounds
626 _ => Ok(Self::TRUE_OR_FALSE),
627 }
628 }
629
630 /// Compute the logical negation of this (boolean) interval.
631 pub fn not(&self) -> Result<Self> {

Callers 4

apply_operatorFunction · 0.45
apply_operatorMethod · 0.45
string_concat_coercionFunction · 0.45

Calls 2

contains_valueMethod · 0.80
valuesMethod · 0.45

Tested by 1