maropu commented on a change in pull request #30974:
URL: https://github.com/apache/spark/pull/30974#discussion_r551088050
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
##########
@@ -2613,6 +2613,19 @@ class DataFrameSuite extends QueryTest
val df = l.join(r, $"col2" === $"col4", "LeftOuter")
checkAnswer(df, Row("2", "2"))
}
+
+ test("SPARK-33939: Make Column.named use UnresolvedAlias to assign name") {
+ val df = spark.range(1).selectExpr("id as id1", "id as id2")
+ val df1 = df.selectExpr("cast(struct(id1, id2).id1 as int)")
+ assert(df1.schema.head.name == "CAST(struct(id1, id2).id1 AS INT)")
Review comment:
nit: could you add tests for the array of structs?
----------------------------------------------------------------
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]