ulysses-you commented on a change in pull request #30974:
URL: https://github.com/apache/spark/pull/30974#discussion_r551191349



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/Column.scala
##########
@@ -200,6 +203,7 @@ class Column(val expr: Expression) extends Logging {
     // Wait until the struct is resolved. This will generate a nicer looking 
alias.
     case struct: CreateNamedStruct => UnresolvedAlias(struct)
 
+    case expr: Expression if existsUnresolvedExtractValue(expr) => 
UnresolvedAlias(expr)

Review comment:
       It has the same problem, but `struct_col.field` is much better than 
`struct_col[field]`.
   
   Other hand, `sql("select id == null")` also has the `CAST` which is 
different with `selectExpr("select id == null")`. It depends on when to assign 
name (before or after analysis).




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

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