Divides `lhs` by `rhs` but replaces division-by-zero errors with NULL; note that this is semantically equivalent to `NULLIF(rhs, 0)`.
(lhs: Expr<Aug>, rhs: Expr<Aug>)
| 103 | // Divides `lhs` by `rhs` but replaces division-by-zero errors with NULL; |
| 104 | // note that this is semantically equivalent to `NULLIF(rhs, 0)`. |
| 105 | fn plan_divide(lhs: Expr<Aug>, rhs: Expr<Aug>) -> Expr<Aug> { |
| 106 | lhs.divide(Expr::Case { |
| 107 | operand: None, |
| 108 | conditions: vec![rhs.clone().equals(Expr::number("0"))], |
| 109 | results: vec![Expr::null()], |
| 110 | else_result: Some(Box::new(rhs)), |
| 111 | }) |
| 112 | } |
| 113 | |
| 114 | fn plan_agg( |
| 115 | &mut self, |