wecharyu commented on code in PR #9343:
URL: https://github.com/apache/hudi/pull/9343#discussion_r1284528276
##########
hudi-common/src/main/java/org/apache/hudi/metadata/FileSystemBackedTableMetadata.java:
##########
@@ -168,57 +167,66 @@ private List<String>
getPartitionPathWithPathPrefixUsingFilterExpression(String
// TODO: Get the parallelism from HoodieWriteConfig
int listingParallelism = Math.min(DEFAULT_LISTING_PARALLELISM,
pathsToList.size());
- // List all directories in parallel:
- // if current dictionary contains PartitionMetadata, add it to result
- // if current dictionary does not contain PartitionMetadata, add its
subdirectory to queue to be processed.
+ // List all directories in parallel
engineContext.setJobStatus(this.getClass().getSimpleName(), "Listing all
partitions with prefix " + relativePathPrefix);
- // result below holds a list of pair. first entry in the pair optionally
holds the deduced list of partitions.
- // and second entry holds optionally a directory path to be processed
further.
- List<Pair<Option<String>, Option<Path>>> result =
engineContext.flatMap(pathsToList, path -> {
+ List<FileStatus> dirToFileListing = engineContext.flatMap(pathsToList,
path -> {
FileSystem fileSystem = path.getFileSystem(hadoopConf.get());
- if (HoodiePartitionMetadata.hasPartitionMetadata(fileSystem, path)) {
- return
Stream.of(Pair.of(Option.of(FSUtils.getRelativePartitionPath(dataBasePath.get(),
path)), Option.empty()));
- }
- return Arrays.stream(fileSystem.listStatus(path, p -> {
- try {
- return fileSystem.isDirectory(p) &&
!p.getName().equals(HoodieTableMetaClient.METAFOLDER_NAME);
Review Comment:
The latency occurs here, it can be avoid by store `FileStatus` instead of
`Path`, and I will move it to next stage in parallel. BTW HUDI-6476 can reduce
tasks for unpartitioned table.
--
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]