Github user gengliangwang commented on a diff in the pull request:
https://github.com/apache/spark/pull/23165#discussion_r237512471
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala
---
@@ -94,18 +94,34 @@ object PartitioningUtils {
paths: Seq[Path],
typeInference: Boolean,
basePaths: Set[Path],
+ userSpecifiedSchema: Option[StructType],
+ caseSensitive: Boolean,
timeZoneId: String): PartitionSpec = {
- parsePartitions(paths, typeInference, basePaths,
DateTimeUtils.getTimeZone(timeZoneId))
+ parsePartitions(paths, typeInference, basePaths, userSpecifiedSchema,
+ caseSensitive, DateTimeUtils.getTimeZone(timeZoneId))
}
private[datasources] def parsePartitions(
paths: Seq[Path],
typeInference: Boolean,
basePaths: Set[Path],
+ userSpecifiedSchema: Option[StructType],
+ caseSensitive: Boolean,
timeZone: TimeZone): PartitionSpec = {
+ val userSpecifiedDataTypes = if (userSpecifiedSchema.isDefined) {
+ val nameToDataType = userSpecifiedSchema.get.fields.map(f => f.name
-> f.dataType).toMap
+ if (caseSensitive) {
+ CaseInsensitiveMap(nameToDataType)
--- End diff --
Yes, thanks for pointing it out :)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]