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

2020-03-25 Thread GitBox
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_r397816937
 
 

 ##
 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:
   btw, to make reviwers understood easily,  you had better clearly write the 
PR description, what's an issue, example queries to reproduce the issue, and 
how-to-fix.


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:
us...@infra.apache.org


With regards,
Apache Git Services

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



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

2020-03-25 Thread GitBox
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,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:
us...@infra.apache.org


With regards,
Apache Git Services

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