mihailotim-db commented on code in PR #49029:
URL: https://github.com/apache/spark/pull/49029#discussion_r1886502233
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala:
##########
@@ -528,11 +530,22 @@ abstract class UnresolvedStarBase(target:
Option[Seq[String]]) extends Star with
// (i.e. [name].* is both a table and a struct), the struct path can
always be qualified.
val attribute = resolve(target.get, resolver)
if (attribute.isDefined) {
+ // If cleanupNestedAliasesDuringStructExpansion is true, we remove
nested aliases during
+ // struct expansion. This is something which is done in the
CleanupAliases rule but for the
+ // single-pass analyzer it has to be done here to avoid additional tree
traversals.
Review Comment:
We probably can't do that without breaking current behavior. I've
encountered multiple examples where nested `Aliases` are actually used in
computing the name of the outer `Alias`. Removing inner `Alias` before
computing the outer one will result in schema changes
--
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]