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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -490,15 +510,17 @@ class Analyzer(override val catalogManager: 
CatalogManager) extends RuleExecutor
             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))()
             case e =>
-              Alias(e, toPrettySQL(e))(explicitMetadata = 
Some(metaForAutoGeneratedAlias))

Review Comment:
   Yep, I over-protected myself to catch all cases of `toPrettySQL()`. Let me 
revert this.



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