Check if the current expression is at the root level for struct unnest purposes. This is true if: 1. The expression IS the root expression, OR 2. The root expression is an Alias wrapping this expression This allows `unnest(struct_col) AS alias` to work, where the alias is simply ignored for struct unnest (matching DuckDB behavior).
(&self, expr: &Expr)
| 416 | /// This allows `unnest(struct_col) AS alias` to work, where the alias is simply |
| 417 | /// ignored for struct unnest (matching DuckDB behavior). |
| 418 | fn is_at_struct_allowed_root(&self, expr: &Expr) -> bool { |
| 419 | if expr == self.root_expr { |
| 420 | return true; |
| 421 | } |
| 422 | // Allow struct unnest when root is an alias wrapping the unnest |
| 423 | if let Expr::Alias(Alias { expr: inner, .. }) = self.root_expr { |
| 424 | return inner.as_ref() == expr; |
| 425 | } |
| 426 | false |
| 427 | } |
| 428 | |
| 429 | fn transform( |
| 430 | &mut self, |