mgaido91 commented on a change in pull request #23894: 
[SPARK-26990][SQL]FileIndex: use user specified field names if possible
URL: https://github.com/apache/spark/pull/23894#discussion_r260180060
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala
 ##########
 @@ -111,15 +111,16 @@ object PartitioningUtils {
       caseSensitive: Boolean,
       validatePartitionColumns: Boolean,
       timeZone: TimeZone): PartitionSpec = {
-    val userSpecifiedDataTypes = if (userSpecifiedSchema.isDefined) {
+    val (userSpecifiedDataTypes, userSpecifiedNames) = if 
(userSpecifiedSchema.isDefined) {
 
 Review comment:
   just a nit: we can maybe separate the `userSpecifiedNames` map creation in 
order to improve code readability. Moreover we need it only if 
`!caseSensitive`. So what about:
   ```
   val userSpecifiedNames = userSpecifiedSchema.filterNot(_ => 
caseSensitive).map { schema => CaseInsensitiveMap(...) 
}.getOrElse(Map.empty[String, String])
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to