Evaluate an entire expression, by delegating to the fine-grained methods on [Interpreter].
(&self, expr: &MirScalarExpr)
| 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. |