[HUDI-6476] Improve the performance of getAllPartitionPaths#9121
Merged
danny0405 merged 1 commit intoapache:masterfrom Jul 5, 2023
Merged
[HUDI-6476] Improve the performance of getAllPartitionPaths#9121danny0405 merged 1 commit intoapache:masterfrom
danny0405 merged 1 commit intoapache:masterfrom
Conversation
Collaborator
danny0405
reviewed
Jul 5, 2023
| partitionPaths.addAll(result.stream().filter(entry -> entry.getKey().isPresent()).map(entry -> entry.getKey().get()) | ||
| .collect(Collectors.toList())); | ||
| partitionPaths.addAll(result.stream().filter(entry -> entry.getKey().isPresent()).map(entry -> entry.getKey().get()) | ||
| .collect(Collectors.toList())); |
Contributor
There was a problem hiding this comment.
good point, the code looks much simpler!
danny0405
approved these changes
Jul 5, 2023
nsivabalan
reviewed
Jul 14, 2023
| FileSystem fileSystem = path.getFileSystem(hadoopConf.get()); | ||
| return Arrays.stream(fileSystem.listStatus(path)); | ||
| if (HoodiePartitionMetadata.hasPartitionMetadata(fileSystem, path)) { | ||
| return Stream.of(Pair.of(Option.of(FSUtils.getRelativePartitionPath(new Path(datasetBasePath), path)), Option.empty())); |
Contributor
There was a problem hiding this comment.
partition meta file could have extensions like parquet, orc etc. did we consider that?
this was in previous code:
fileStatus.getPath().getName().startsWith(HoodiePartitionMetadata.HOODIE_PARTITION_METAFILE_PREFIX)
Contributor
Author
There was a problem hiding this comment.
Thanks for your careful check, this case will be handled in HoodiePartitionMetadata#hasPartitionMetadata:
codope
added a commit
to codope/hudi
that referenced
this pull request
Aug 2, 2023
…pache#9121)" This reverts commit 72f0477.
codope
added a commit
to codope/hudi
that referenced
this pull request
Aug 2, 2023
…pache#9121)" This reverts commit 72f0477.
codope
added a commit
to codope/hudi
that referenced
this pull request
Aug 2, 2023
…pache#9121)" This reverts commit 72f0477.
nsivabalan
pushed a commit
that referenced
this pull request
Aug 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Logs
Currently Hudi will list all status of files in hudi table directory, which can be avoid to improve the performance of getAllPartitionPaths, especially for the non-partitioned table with many files. What we change in this patch:
getPartitionPathWithPathPrefix().hoodie/.hoodie_partition_metadataImpact
Performance improvement.
Risk level (write none, low medium or high below)
None.
Documentation Update
None.
Contributor's checklist