mihailotim-db commented on code in PR #55606:
URL: https://github.com/apache/spark/pull/55606#discussion_r3182759129
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1868,7 +1868,14 @@ class Analyzer(
// Only Project, Aggregate, CollectMetrics can host star
expressions.
case u @ (_: Project | _: Aggregate | _: CollectMetrics) =>
Try(s.expand(u.children.head, resolver)) match {
- case Success(expanded) => expanded.map(wrapOuterReference)
+ case Success(expanded) =>
+ expanded.map {
+ case alias: Alias =>
+
alias.withNewChildren(Seq(wrapOuterReference(alias.child)))
+ .asInstanceOf[Alias]
Review Comment:
The struct case is now handled differently: expand() returns bare
wrapOuterReference results (which handles the struct Alias
correctly), and aliasIfOuterReference in buildExpandedProjectList skips
expressions that are already Alias nodes. So no
withNewChildren + cast needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]