danny0405 commented on code in PR #18047:
URL: https://github.com/apache/hudi/pull/18047#discussion_r2762033309
##########
hudi-common/src/main/java/org/apache/hudi/metadata/FileSystemBackedTableMetadata.java:
##########
@@ -349,16 +349,10 @@ public Map<Pair<String, StoragePath>,
List<StoragePathInfo>> listPartitions(List
for (Pair<String, StoragePath> partitionPair : partitionPathList) {
StoragePath absolutePartitionPath = partitionPair.getRight();
- try {
- pathInfoMap.put(partitionPair,
getStorage().listDirectEntries(absolutePartitionPath));
- } catch (IOException e) {
- if (!getStorage().exists(absolutePartitionPath)) {
- pathInfoMap.put(partitionPair, Collections.emptyList());
- } else {
- // in case the partition path was created by another caller
- pathInfoMap.put(partitionPair,
getStorage().listDirectEntries(absolutePartitionPath));
- }
- }
+ // Use FSUtils.getAllDataFilesInPartition to filter out stray files that
are not valid
+ // HUDI data or log files. This is consistent with
getAllFilesInPartition() and
+ // getAllFilesInPartitions() methods which also use this filtering.
+ pathInfoMap.put(partitionPair,
FSUtils.getAllDataFilesInPartition(getStorage(), absolutePartitionPath));
Review Comment:
what about this one `// in case the partition path was created by another
caller` ?
--
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]