Insert the expression into this class, meaning it is known to be equal to all other expressions in this class.
(&mut self, expr: Arc<dyn PhysicalExpr>)
| 202 | /// Insert the expression into this class, meaning it is known to be equal to |
| 203 | /// all other expressions in this class. |
| 204 | pub fn push(&mut self, expr: Arc<dyn PhysicalExpr>) { |
| 205 | if let Some(lit) = expr.downcast_ref::<Literal>() { |
| 206 | let expr_across = AcrossPartitions::Uniform(Some(lit.value().clone())); |
| 207 | if let Some(across) = self.constant.as_mut() { |
| 208 | // TODO: Return an error if constant values do not agree. |
| 209 | if *across == AcrossPartitions::Heterogeneous { |
| 210 | *across = expr_across; |
| 211 | } |
| 212 | } else { |
| 213 | self.constant = Some(expr_across); |
| 214 | } |
| 215 | } |
| 216 | self.exprs.insert(expr); |
| 217 | } |
| 218 | |
| 219 | /// Inserts all the expressions from other into this class. |
| 220 | pub fn extend(&mut self, other: Self) { |