boneanxs commented on code in PR #5723:
URL: https://github.com/apache/hudi/pull/5723#discussion_r892034945
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieBaseRelation.scala:
##########
@@ -340,6 +340,21 @@ abstract class HoodieBaseRelation(val sqlContext:
SQLContext,
latestBaseFiles.groupBy(getPartitionPath)
}
+ protected def getSelectedPartitionPaths(
+ globbedPaths: Seq[Path],
+ partitionFilters: Seq[Expression],
+ dataFilters: Seq[Expression]): Seq[Path] = {
+ val partitionDirs = if (globbedPaths.isEmpty) {
+ fileIndex.listFiles(partitionFilters, dataFilters)
+ } else {
+ val inMemoryFileIndex = HoodieInMemoryFileIndex.create(sparkSession,
globbedPaths)
+ inMemoryFileIndex.listFiles(partitionFilters, dataFilters)
+ }
+
+ val fsView = new HoodieTableFileSystemView(metaClient, timeline,
partitionDirs.flatMap(_.files).toArray)
Review Comment:
Here I move the codes to its caller `collectFileSplits` to reuse
`HoodieTableFileSystemView` and `HoodieInMemoryFileIndex`. Also I think this
can address the TODO that avoid iterating over listed files multiple times.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]