Calculate the output partitioning after applying the given projection.
(
&self,
mapping: &ProjectionMapping,
input_eq_properties: &EquivalenceProperties,
)
| 273 | |
| 274 | /// Calculate the output partitioning after applying the given projection. |
| 275 | pub fn project( |
| 276 | &self, |
| 277 | mapping: &ProjectionMapping, |
| 278 | input_eq_properties: &EquivalenceProperties, |
| 279 | ) -> Self { |
| 280 | if let Partitioning::Hash(exprs, part) = self { |
| 281 | let normalized_exprs = input_eq_properties |
| 282 | .project_expressions(exprs, mapping) |
| 283 | .zip(exprs) |
| 284 | .map(|(proj_expr, expr)| { |
| 285 | proj_expr.unwrap_or_else(|| { |
| 286 | Arc::new(UnKnownColumn::new(&expr.to_string())) |
| 287 | }) |
| 288 | }) |
| 289 | .collect(); |
| 290 | Partitioning::Hash(normalized_exprs, *part) |
| 291 | } else { |
| 292 | self.clone() |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | impl PartialEq for Partitioning { |