Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/7238#discussion_r35409246 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/parquet/newParquet.scala --- @@ -345,6 +348,28 @@ private[sql] class ParquetRelation2( // Schema of the whole table, including partition columns. var schema: StructType = _ + def filterDataStatusesWithoutSummaries( + leaves: Seq[FileStatus], + dataStatuses: Seq[FileStatus]): Seq[FileStatus] = { + + // Get the partitions that have summary files + val typeInference = sqlContext.conf.partitionColumnTypeInferenceEnabled() + val summariesPaths = metadataStatuses.map(_.getPath.getParent()) ++ + commonMetadataStatuses.map(_.getPath.getParent()) + val summariesPartitions = PartitioningUtils.parsePartitions(summariesPaths, + PartitioningUtils.DEFAULT_PARTITION_NAME, typeInference).partitions.toSet + + dataStatuses.filterNot { d => + val part = PartitioningUtils.parsePartitions(Seq(d.getPath.getParent()), + PartitioningUtils.DEFAULT_PARTITION_NAME, typeInference) + if (summariesPartitions.size > 0 && part.partitions.length > 0) { + summariesPartitions.contains(part.partitions(0)) + } else { + false + } + } + } --- End diff -- Under current implementation, the summary files and part-files are all scanned and merged. I think it is accepted and can guarantee to deal possible problems.
--- 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