linhongliu-db commented on a change in pull request #32832:
URL: https://github.com/apache/spark/pull/32832#discussion_r658436593



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -432,10 +432,26 @@ class Analyzer(override val catalogManager: 
CatalogManager)
             case e if !e.resolved => u
             case g: Generator => MultiAlias(g, Nil)
             case c @ Cast(ne: NamedExpression, _, _, _) => Alias(c, ne.name)()
-            case e: ExtractValue => Alias(e, toPrettySQL(e))()
+            case e: ExtractValue =>
+              val onlyExtract = e.collect {
+                case _: ExtractValue => true
+                case _ => false
+              }.forall(a => a)
+              if (onlyExtract) {
+                Alias(e, toPrettySQL(e))()
+              } else {
+                val meta = new MetadataBuilder()
+                  .putString("autoGeneratedAlias", "true")

Review comment:
       could we change this to something like `__unstableAlias`? because for 
example, the alias for `extractOnly` is also auto-generated.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to