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/03/25 10:21:22 UTC

[GitHub] [spark] maropu commented on a change in pull request #27993: [SPARK-30996][Core] invaild parquet map key type

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

 ##########
 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:
   I'm not sure about what's your suggestion;
   ```
   scala> val df = Seq(Map(Map(1 -> 1) -> 1L)).toDF("map")
   df: org.apache.spark.sql.DataFrame = [map: map<map<int,int>,bigint>]
   
   scala> df.printSchema
   root
    |-- map: map (nullable = true)
    |    |-- key: map
    |    |    |-- key: integer
    |    |    |-- value: integer (valueContainsNull = false)
    |    |-- value: long (valueContainsNull = false)
   
   
   scala> df.write.mode("overwrite").parquet("/tmp/test")
   
   scala>  spark.read.load("/tmp/test").printSchema()
   root
    |-- map: map (nullable = true)
    |    |-- key: map
    |    |    |-- key: integer
    |    |    |-- value: integer (valueContainsNull = true)
    |    |-- value: long (valueContainsNull = true)
   ```
   Any issue here?

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


With regards,
Apache Git Services

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