MaxGekk commented on code in PR #39332:
URL: https://github.com/apache/spark/pull/39332#discussion_r1065877561


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -494,15 +498,17 @@ class Analyzer(override val catalogManager: 
CatalogManager)
             case c @ Cast(ne: NamedExpression, _, _, _) => Alias(c, ne.name)()
             case e: ExtractValue =>
               if (extractOnly(e)) {
-                Alias(e, toPrettySQL(e))()
+                Alias(e, getAlias(e, optGenAliasFunc))()
               } else {
-                Alias(e, toPrettySQL(e))(explicitMetadata = 
Some(metaForAutoGeneratedAlias))
+                Alias(e, getAlias(e, optGenAliasFunc))(
+                  explicitMetadata = Some(metaForAutoGeneratedAlias))
               }
             case e if optGenAliasFunc.isDefined =>
               Alias(child, optGenAliasFunc.get.apply(e))()
-            case l: Literal => Alias(l, toPrettySQL(l))()
+            case l: Literal => Alias(l, getAlias(l, optGenAliasFunc))()

Review Comment:
   @cloud-fan At the moment (since the PR is a draft one) I just stupidly 
replaced all `toPrettySQL` to exclude any fallback to old way of alias 
generation.
   
   I am mostly interested in how alias are generated because updating all tests 
+ regenerating golden files is pretty time consuming thing. We need to agree of 
the rules how aliases are generated first of all. Other things are minor for 
now, IMHO. 



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