You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "CTTY (via GitHub)" <gi...@apache.org> on 2023/03/16 18:15:29 UTC

[GitHub] [hudi] CTTY commented on a diff in pull request #8190: [HUDI-5936] Fix serialization problem when FileStatus is not serializable

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


##########
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:
   Sorry for the confusion, `FileStatus` in Hadoop2 is not serializable. And for some customized FS implementations like EMRFS it could also be an issue if they are not aware of serialization issue



-- 
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-unsubscribe@hudi.apache.org

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