cloud-fan commented on code in PR #40126:
URL: https://github.com/apache/spark/pull/40126#discussion_r1141983844


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -488,16 +477,13 @@ 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 e: ExtractValue =>
-              if (extractOnly(e)) {
-                Alias(e, toPrettySQL(e))()
-              } else {
-                Alias(e, toPrettySQL(e))(explicitMetadata = 
Some(metaForAutoGeneratedAlias))
-              }
             case e if optGenAliasFunc.isDefined =>
               Alias(child, optGenAliasFunc.get.apply(e))()
             case l: Literal => Alias(l, toPrettySQL(l))()
             case e =>
+              val metaForAutoGeneratedAlias = new MetadataBuilder()
+                .putString("__autoGeneratedAlias", "true")
+                .build()

Review Comment:
   To be safe and not change DataFrame behavior, can we not add this metadata 
if the expression is extractOnly?



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

Reply via email to