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

Method and

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

Compute the logical conjunction of this (boolean) interval with the given boolean interval.

(&self, other: T)

Source from the content-addressed store, hash-verified

580 /// Compute the logical conjunction of this (boolean) interval with the
581 /// given boolean interval.
582 pub fn and<T: Borrow<Self>>(&self, other: T) -> Result<Self> {
583 let rhs = other.borrow();
584 match (&self.lower, &self.upper, &rhs.lower, &rhs.upper) {
585 (
586 &ScalarValue::Boolean(Some(self_lower)),
587 &ScalarValue::Boolean(Some(self_upper)),
588 &ScalarValue::Boolean(Some(other_lower)),
589 &ScalarValue::Boolean(Some(other_upper)),
590 ) => {
591 let lower = self_lower && other_lower;
592 let upper = self_upper && other_upper;
593
594 Ok(Self {
595 lower: ScalarValue::Boolean(Some(lower)),
596 upper: ScalarValue::Boolean(Some(upper)),
597 })
598 }
599
600 // Return TRUE_OR_FALSE when intervals don't have concrete boolean bounds
601 _ => Ok(Self::TRUE_OR_FALSE),
602 }
603 }
604
605 /// Compute the logical disjunction of this boolean interval with the
606 /// given boolean interval.

Callers 3

apply_operatorFunction · 0.45
apply_operatorMethod · 0.45

Calls 2

contains_valueMethod · 0.80
valuesMethod · 0.45

Tested by 1