You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2023/01/09 15:21:16 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #39332: [WIP][SPARK-40822][SQL] Stable derived column aliases

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


##########
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:
   We don't need this change as the above case is `case e if optGenAliasFunc.isDefined`



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org