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

Method may_contain

src/expr/src/interpret.rs:108–125  ·  view source on GitHub ↗
(&self, value: Datum<'a>)

Source from the content-addressed store, hash-verified

106 }
107
108 fn may_contain(&self, value: Datum<'a>) -> bool {
109 match self {
110 Values::Empty => false,
111 Values::Within(min, max) => *min <= value && value <= *max,
112 Values::All => true,
113 Values::Nested(field_map) => match value {
114 Datum::Map(datum_map) => {
115 datum_map
116 .iter()
117 .all(|(key, val)| match field_map.get(&key.into()) {
118 None => true,
119 Some(nested) => nested.may_contain(val),
120 })
121 }
122 _ => false,
123 },
124 }
125 }
126
127 /// Returns the sole datum in this value set, if it is known to be a single
128 /// value. Returns `None` otherwise (for empty sets, ranges with distinct

Callers 3

filter_resultFunction · 0.80
test_interpretFunction · 0.80
may_match_mfpMethod · 0.80

Calls 3

allMethod · 0.80
iterMethod · 0.45
getMethod · 0.45

Tested by 1

test_interpretFunction · 0.64