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

Method expr

src/expr/src/interpret.rs:417–442  ·  view source on GitHub ↗

Evaluate an entire expression, by delegating to the fine-grained methods on [Interpreter].

(&self, expr: &MirScalarExpr)

Source from the content-addressed store, hash-verified

415
416 /// Evaluate an entire expression, by delegating to the fine-grained methods on [Interpreter].
417 fn expr(&self, expr: &MirScalarExpr) -> Self::Summary {
418 match expr {
419 MirScalarExpr::Column(id, _name) => self.column(*id),
420 MirScalarExpr::Literal(value, col_type) => self.literal(value, col_type),
421 MirScalarExpr::CallUnmaterializable(func) => self.unmaterializable(func),
422 MirScalarExpr::CallUnary { func, expr } => {
423 let expr_range = self.expr(expr);
424 self.unary(func, expr_range)
425 }
426 MirScalarExpr::CallBinary { func, expr1, expr2 } => {
427 let expr1_range = self.expr(expr1);
428 let expr2_range = self.expr(expr2);
429 self.binary(func, expr1_range, expr2_range)
430 }
431 MirScalarExpr::CallVariadic { func, exprs } => {
432 let exprs: Vec<_> = exprs.into_iter().map(|e| self.expr(e)).collect();
433 self.variadic(func, exprs)
434 }
435 MirScalarExpr::If { cond, then, els } => {
436 let cond_range = self.expr(cond);
437 let then_range = self.expr(then);
438 let els_range = self.expr(els);
439 self.cond(cond_range, then_range, els_range)
440 }
441 }
442 }
443
444 /// Specifically, this evaluates the map and filters stages of an MFP: summarize each of the
445 /// map expressions, then `and` together all of the filters.

Callers 15

fmt_textMethod · 0.45
newMethod · 0.45
mfp_filterMethod · 0.45
mfp_plan_filterMethod · 0.45
newMethod · 0.45
mfp_filterMethod · 0.45
mfp_plan_filterMethod · 0.45
checkFunction · 0.45
test_concatFunction · 0.45
test_eval_rangeFunction · 0.45
test_jsonbFunction · 0.45

Implementers 1

interpret.rssrc/expr/src/interpret.rs

Calls 10

unmaterializableMethod · 0.80
condMethod · 0.80
columnMethod · 0.45
literalMethod · 0.45
unaryMethod · 0.45
binaryMethod · 0.45
collectMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45
variadicMethod · 0.45