maropu commented on a change in pull request #24202: [SPARK-27268][SQL] Add 
map_keys and map_values support in nested schema pruning.
URL: https://github.com/apache/spark/pull/24202#discussion_r268683439
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala
 ##########
 @@ -253,6 +257,20 @@ abstract class SchemaPruningSuite
     checkAnswer(query, Row(1) :: Nil)
   }
 
+  testSchemaPruning("select nested field from a complex map key using 
map_keys") {
+    val query = sql("select map_keys(relations).middle[0], p from contacts")
+    checkScan(query,
+    "struct<relations:map<struct<middle:string>,string>>")
+    checkAnswer(query, Row("Y.", 1) :: Row("X.", 1) :: Row(null, 2) :: 
Row(null, 2) :: Nil)
+  }
+
+  testSchemaPruning("select nested field from a complex map value using 
map_values") {
+    val query = sql("select map_values(relatives).middle[0], p from contacts")
+    checkScan(query,
+      "struct<relatives:map<string,struct<middle:string>>>")
 
 Review comment:
   ditto

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to