MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / eq

Method eq

src/expr/src/interpret.rs:717–734  ·  view source on GitHub ↗
(left: ResultSpec<'b>, right: ResultSpec<'b>)

Source from the content-addressed store, hash-verified

715 }
716
717 fn eq<'b>(left: ResultSpec<'b>, right: ResultSpec<'b>) -> ResultSpec<'b> {
718 eagerly(left, right, |left, right| {
719 // `eq` might return true if there's any overlap between the range of its two arguments...
720 let maybe_true = match left.clone().intersect(right.clone()) {
721 Values::Empty => ResultSpec::nothing(),
722 _ => ResultSpec::value(Datum::True),
723 };
724
725 // ...and may return false if the union contains at least two distinct values.
726 // Note that the `Empty` case is handled by `eagerly` above.
727 let maybe_false = match left.union(right) {
728 Values::Within(a, b) if a == b => ResultSpec::nothing(),
729 _ => ResultSpec::value(Datum::False),
730 };
731
732 maybe_true.union(maybe_false)
733 })
734 }
735
736 /// `add_timestamp_interval` and friends do calendar-month arithmetic
737 /// with day-clamping, which is non-monotone in either argument when

Callers

nothing calls this directly

Calls 3

intersectMethod · 0.80
cloneMethod · 0.45
unionMethod · 0.45

Tested by

no test coverage detected