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

Function id_gen

src/expr/src/explain.rs:283–294  ·  view source on GitHub ↗

Create an [`Iterator`] for [`LocalId`] values that are guaranteed to be fresh within the scope of the given [`MirRelationExpr`].

(expr: &MirRelationExpr)

Source from the content-addressed store, hash-verified

281// Create an [`Iterator`] for [`LocalId`] values that are guaranteed to be
282// fresh within the scope of the given [`MirRelationExpr`].
283fn id_gen(expr: &MirRelationExpr) -> impl Iterator<Item = LocalId> + use<> {
284 let mut max_id = 0_u64;
285
286 expr.visit_pre(|expr| {
287 match expr {
288 MirRelationExpr::Let { id, .. } => max_id = std::cmp::max(max_id, id.into()),
289 _ => (),
290 };
291 });
292
293 (max_id + 1..).map(LocalId::new)
294}
295
296impl ScalarOps for MirScalarExpr {
297 fn match_col_ref(&self) -> Option<usize> {

Callers 1

enforce_linear_chainsFunction · 0.70

Calls 2

visit_preMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected