MrDLontheway commented on a change in pull request #27993: [SPARK-30996][Core] 
invaild parquet map key type
URL: https://github.com/apache/spark/pull/27993#discussion_r397808676
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormatSuite.scala
 ##########
 @@ -56,4 +55,22 @@ class ParquetFileFormatSuite extends QueryTest with 
ParquetTest with SharedSpark
     }.getCause
     assert(exception.getMessage().contains("Could not read footer for file"))
   }
+
+  test("read parquet map invaild key type") {
+    withTempDir { dir =>
+      val spark_session = spark
+      import spark_session.implicits._
+      val df = Seq(Map(Map(1 -> 1) -> 1L)).toDF("map")
+      val exception = intercept[AnalysisException] {
+        df.write.mode("overwrite").parquet(dir.getPath)
+      }
+      assert(exception.getMessage().contains("Parquet data source does not 
support"))
 
 Review comment:
   o sorry , I seem to be wrong
   This side will make it impossible to read. Let me review it again.
   
   Seq(Seq(Map(Map(1 -> 1) -> StructValue(1L)))).toDF("long1")
   root
    |-- long1: array (nullable = true)
    |    |-- element: map (containsNull = true)
    |    |    |-- key: map
    |    |    |    |-- key: integer
    |    |    |    |-- value: integer (valueContainsNull = false)
    |    |    |-- value: struct (valueContainsNull = true)
    |    |    |    |-- l: long (nullable = false)

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