HyukjinKwon commented on a change in pull request #28860:
URL: https://github.com/apache/spark/pull/28860#discussion_r446112380



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
##########
@@ -3521,6 +3523,25 @@ class SQLQuerySuite extends QueryTest with 
SharedSparkSession with AdaptiveSpark
             |""".stripMargin), Row(1))
     }
   }
+
+  test("SPARK-32002: Support Extract value from nested ArrayStruct") {
+    withTempView("rows") {
+      val df = spark.read
+        .json(Seq(
+          """{"a": [{"b": [{"c": [1,2]}]}]}""",
+          """{"a": [{"b": [{"c": [1]}, {"c": [2]}]}]}""",
+          """{"a":[{}]}""").toDS())
+      df.createOrReplaceTempView("nest")
+
+      checkAnswer(sql(
+        """
+          |SELECT a.b.c FROM nest

Review comment:
       Can we add deeper cases? Also, you can simplify the test cases, for 
example, as below:
   
   ```scala
   val df = 
spark.range(10).select(array(struct(array(struct("id")).alias("col1"))).alias("col0"))
   df.selectExpr("col0.col1.id")
   ```




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