You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/02/26 08:50:10 UTC

[GitHub] mgaido91 commented on a change in pull request #23894: [SPARK-26990][SQL]FileIndex: use user specified field names if possible

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


With regards,
Apache Git Services

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