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

Method let_in

src/expr/src/relation.rs:1586–1607  ·  view source on GitHub ↗

Store `self` in a `Let` and pass the corresponding `Get` to `body`.

(self, id_gen: &mut IdGen, body: Body)

Source from the content-addressed store, hash-verified

1584
1585 /// Store `self` in a `Let` and pass the corresponding `Get` to `body`.
1586 pub fn let_in<Body, E>(self, id_gen: &mut IdGen, body: Body) -> Result<MirRelationExpr, E>
1587 where
1588 Body: FnOnce(&mut IdGen, MirRelationExpr) -> Result<MirRelationExpr, E>,
1589 {
1590 if let MirRelationExpr::Get { .. } = self {
1591 // already done
1592 body(id_gen, self)
1593 } else {
1594 let id = LocalId::new(id_gen.allocate_id());
1595 let get = MirRelationExpr::Get {
1596 id: Id::Local(id),
1597 typ: self.typ(),
1598 access_strategy: AccessStrategy::UnknownOrLocal,
1599 };
1600 let body = (body)(id_gen, get)?;
1601 Ok(MirRelationExpr::Let {
1602 id,
1603 value: Box::new(self),
1604 body: Box::new(body),
1605 })
1606 }
1607 }
1608
1609 /// Return every row in `self` that does not have a matching row in the first columns of `keys_and_values`, using `default` to fill in the remaining columns
1610 /// (If `default` is a row of nulls, this is the 'outer' part of LEFT OUTER JOIN)

Callers 9

anti_lookupMethod · 0.80
lookupMethod · 0.80
lowerMethod · 0.80
applied_toMethod · 0.80
lower_subqueriesMethod · 0.80
branchFunction · 0.80
apply_scalar_subqueryFunction · 0.80
attempt_outer_equijoinFunction · 0.80

Calls 2

allocate_idMethod · 0.45
typMethod · 0.45

Tested by

no test coverage detected