If the expression matches any of the async functions, return the new column
(
&self,
expr: Arc<dyn PhysicalExpr>,
)
| 351 | |
| 352 | /// If the expression matches any of the async functions, return the new column |
| 353 | pub fn map_expr( |
| 354 | &self, |
| 355 | expr: Arc<dyn PhysicalExpr>, |
| 356 | ) -> Transformed<Arc<dyn PhysicalExpr>> { |
| 357 | // find the first matching async function if any |
| 358 | let Some(idx) = |
| 359 | self.async_exprs |
| 360 | .iter() |
| 361 | .enumerate() |
| 362 | .find_map(|(idx, async_expr)| { |
| 363 | if async_expr.func == Arc::clone(&expr) { |
| 364 | Some(idx) |
| 365 | } else { |
| 366 | None |
| 367 | } |
| 368 | }) |
| 369 | else { |
| 370 | return Transformed::no(expr); |
| 371 | }; |
| 372 | // rewrite in terms of the output column |
| 373 | Transformed::yes(self.output_column(idx)) |
| 374 | } |
| 375 | |
| 376 | /// return the output column for the async function at index idx |
| 377 | pub fn output_column(&self, idx: usize) -> Arc<dyn PhysicalExpr> { |
no test coverage detected