ulysses-you commented on a change in pull request #30974:
URL: https://github.com/apache/spark/pull/30974#discussion_r551157649
##########
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:
The reason why not check other `Expression` is `UnresolvedAlias` will
introduce `CAST` to assgin name duing analysis if exists type cast implicitly.
As I said above
> Before that df.selectExpr("id1 == null").schema.head.name is (id1 = NULL),
after that it changed to (id1 = CAST(NULL AS INT)).
Narrow to checked `UnresolvedExtractValue` is just a tradeoff.
----------------------------------------------------------------
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]