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


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

Review Comment:
   We can handle `ExtractValue` better:
   1. for field access like `some_expr.c`, use the field name as the alias
   2. for map lookup with string literal like `map_col['key']`, use the key 
string as the alias
   3. for others, invoke `optGenAliasFunc `



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