HyukjinKwon commented on a change in pull request #29645:
URL: https://github.com/apache/spark/pull/29645#discussion_r483467868
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala
##########
@@ -1537,4 +1576,230 @@ class ColumnExpressionSuite extends QueryTest with
SharedSparkSession {
Row(3) :: Row(null):: Nil,
StructType(Seq(StructField("a", IntegerType, nullable = true))))
}
+
+ test("withField should add field to struct of array") {
+ checkAnswerAndSchema(
+ arrayLevel1.withColumn("a", 'a.withField("d", lit(4))),
Review comment:
@viirya, BTW, is it same as:
```scala
transform($"struct_col", _.withField("new_col", col))
```
?
----------------------------------------------------------------
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]