Skip to content

Commit

Permalink
Reuse ScopedExpression child name
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Nov 22, 2024
1 parent a2a0678 commit 1ce9a5e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ object AliasResolution {
case e if !e.resolved => u
case g: Generator => MultiAlias(g, Nil)
case c @ Cast(ne: NamedExpression, _, _, _) => Alias(c, ne.name)()
case se @ ScopedExpression(ne: NamedExpression, _) => Alias(se, ne.name)()
case se @ ScopedExpression(e: Expression, _) =>
resolve(UnresolvedAlias(e, optGenAliasFunc)) match {
case ne: NamedExpression => Alias(se, ne.name)()
case _ => se
}
case e: ExtractValue if extractOnly(e) => Alias(e, toPrettySQL(e))()
case e if optGenAliasFunc.isDefined =>
Alias(child, optGenAliasFunc.get.apply(e))()
Expand Down

0 comments on commit 1ce9a5e

Please sign in to comment.