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

    https://github.com/apache/spark/pull/23165#discussion_r237515959
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala
 ---
    @@ -250,7 +276,13 @@ object PartitioningUtils {
           val rawColumnValue = columnSpec.drop(equalSignIndex + 1)
           assert(rawColumnValue.nonEmpty, s"Empty partition column value in 
'$columnSpec'")
     
    -      val literal = inferPartitionColumnValue(rawColumnValue, 
typeInference, timeZone)
    +      val literal = if (userSpecifiedDataTypes.contains(columnName)) {
    +        // SPARK-26188: if user provides corresponding column schema, 
process the column as String
    +        //              type and cast it as user specified data type later.
    --- End diff --
    
    1. the function returns `Option[(String, Literal)]`
    2. the function `inferPartitionColumnValue` is quite complex, don't want 
change it or write duplicated logic.


---

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

Reply via email to