Github user mgaido91 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20621#discussion_r168923873
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetPartitionDiscoverySuite.scala
 ---
    @@ -1120,4 +1120,16 @@ class ParquetPartitionDiscoverySuite extends 
QueryTest with ParquetTest with Sha
               Row(3, BigDecimal("2" * 30)) :: Nil)
         }
       }
    +
    +  test("SPARK-23436: invalid Dates should be inferred as String in 
partition inference") {
    +    withTempPath { path =>
    +      val data = Seq(("1", "2018-01", "2018-01-01-04", "test"))
    +        .toDF("id", "date_month", "date_hour", "data")
    +
    +      data.write.partitionBy("date_month", 
"date_hour").parquet(path.getAbsolutePath)
    +      val input = spark.read.parquet(path.getAbsolutePath)
    +      checkAnswer(input.select("id", "date_month", "date_hour", "data"),
    --- End diff --
    
    I think it is not necessary, but I will add this check, thanks.


---

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

Reply via email to