Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/7238#discussion_r35783458
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetRelation.scala ---
@@ -330,6 +333,28 @@ private[sql] class ParquetRelation(
}
}
+ def filterDataStatusesWithoutSummaries(
+ leaves: Seq[FileStatus],
+ dataStatuses: Seq[FileStatus]): Seq[FileStatus] = {
+ // Get the paths that have summary files
+ val directoriesWithSummaries =
leaves.map(_.getPath.getParent.toString).toSet
+
+ val typeInference =
sqlContext.conf.partitionColumnTypeInferenceEnabled()
+ val dataPaths = dataStatuses.map(_.getPath.getParent)
+ val dataPathsWithoutSummaries =
PartitioningUtils.parsePartitions(dataPaths,
+ PartitioningUtils.DEFAULT_PARTITION_NAME, typeInference).partitions
+ .map(_.path).filterNot(p =>
directoriesWithSummaries.contains(p)).toSet
--- End diff --
This is still problematic. For a non-partitioned table like this:
```
base/
_metadata
_common_data
file-1
file-2
...
```
`parsePartitions` always returns an empty `PartitionSpec` containing no
`Partition`s, thus `dataPathsWithoutSummaries` is always empty, and we always
merge all part-files, which is not expected behavior.
However, as what I suggested in the other comment, we can probably just
remove this method.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]