codope commented on code in PR #5723:
URL: https://github.com/apache/hudi/pull/5723#discussion_r891308637


##########
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:
   it's being repeated in `listLatestBaseFiles`. Let's extract to a method?
   Also, I think it would be better if we keep the API signatures similar if 
possible. Currently, `listLatestBaseFiles` returns a Map while this method 
returns a Seq.



-- 
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]

Reply via email to