File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,23 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession
231231 }
232232 }
233233
234+ testStandardAndLegacyModes(" nested map with struct as key type" ) {
235+ val data = (1 to 4 ).map { i =>
236+ Tuple1 (
237+ Map (
238+ (i, s " kA_ $i" ) -> s " vA_ $i" ,
239+ (i, s " kB_ $i" ) -> s " vB_ $i"
240+ )
241+ )
242+ }
243+ withParquetDataFrame(data) { df =>
244+ // Structs are converted to `Row`s
245+ checkAnswer(df, data.map { case Tuple1 (m) =>
246+ Row (m.map { case (k, v) => Row (k.productIterator.toSeq: _* ) -> v })
247+ })
248+ }
249+ }
250+
234251 testStandardAndLegacyModes(" nested map with struct as value type" ) {
235252 val data = (1 to 4 ).map { i =>
236253 Tuple1 (
You can’t perform that action at this time.
0 commit comments