CTTY commented on code in PR #8190:
URL: https://github.com/apache/hudi/pull/8190#discussion_r1184505252


##########
hudi-common/src/main/java/org/apache/hudi/metadata/FileSystemBackedTableMetadata.java:
##########
@@ -106,9 +106,9 @@ private List<String> getPartitionPathWithPathPrefix(String 
relativePathPrefix) t
       int listingParallelism = Math.min(DEFAULT_LISTING_PARALLELISM, 
pathsToList.size());
 
       // List all directories in parallel
-      List<FileStatus> dirToFileListing = engineContext.flatMap(pathsToList, 
path -> {
+      List<Pair<Path, Boolean>> dirToFileListing = 
engineContext.flatMap(pathsToList, path -> {
         FileSystem fileSystem = path.getFileSystem(hadoopConf.get());
-        return Arrays.stream(fileSystem.listStatus(path));
+        return Arrays.stream(fileSystem.listStatus(path)).map(fileStatus -> 
Pair.of(fileStatus.getPath(), fileStatus.isDirectory()));
       }, listingParallelism);

Review Comment:
   We need to only use this serializable filestatus when we absolutely need to 
serialize filestatus object, not everywhere. 
   
   In fact I just realized we already have something similiar for Spark 
datasource: 
https://github.com/apache/hudi/blob/21c913d826479931158e9eda30a99036c6e3c585/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/HoodieHadoopFSUtils.scala#LL349C1-L349C1



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to