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

    https://github.com/apache/spark/pull/8840#discussion_r43699130
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/PartitioningUtils.scala
 ---
    @@ -77,8 +77,16 @@ private[sql] object PartitioningUtils {
           defaultPartitionName: String,
           typeInference: Boolean): PartitionSpec = {
         // First, we need to parse every partition's path and see if we can 
find partition values.
    -    val pathsWithPartitionValues = paths.flatMap { path =>
    -      parsePartition(path, defaultPartitionName, typeInference).map(path 
-> _)
    +    val partitionValuesWithBasePaths = paths.map { path =>
    +      path -> parsePartition(path, defaultPartitionName, typeInference)
    +    }
    +
    +    val pathsWithPartitionValues = partitionValuesWithBasePaths.flatMap { 
pathAndPart =>
    +      pathAndPart._2._1.map(part => pathAndPart._1 -> part)
    +    }
    +
    +    val basePaths = partitionValuesWithBasePaths.flatMap { pathAndPart =>
    +      pathAndPart._2._2
    --- End diff --
    
    Can we writhe these like this?
    ```
    val (basePaths, pathsWithPartitionValues) = paths.flatMap {
    }.unzip
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to