You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/04 08:26:29 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #29645: [SPARK-32796][SQL] Make withField API support nested struct in array

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org