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 5, 2024
1 parent cded2a9 commit 517b616
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,11 @@ class Analyzer(override val catalogManager: CatalogManager) extends RuleExecutor
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 517b616

Please sign in to comment.