Skip to content

Commit d846af1

Browse files
committed
Address review comments
1 parent 38dfb7d commit d846af1

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

hudi-common/src/main/java/org/apache/hudi/BaseHoodieTableFileIndex.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ private Map<PartitionPath, List<FileSlice>> filterFiles(List<PartitionPath> part
359359
.collect(Collectors.toList())
360360
));
361361
} finally {
362-
log.info("On {} with query instant as {}, it took {}ms to filter {} files into file slices across {} partitions",
362+
log.debug("On {} with query instant as {}, it took {}ms to filter {} files into file slices across {} partitions",
363363
metaClient.getTableConfig().getTableName(), queryInstant.orElse("N/A"), timer.endTimer(),
364364
allFiles.size(), partitions.size());
365365
}
@@ -376,7 +376,7 @@ protected List<PartitionPath> listPartitionPaths(List<String> relativePartitionP
376376
} catch (IOException e) {
377377
throw new HoodieIOException("Error fetching partition paths", e);
378378
} finally {
379-
log.info("On {}, it took {} ms to list partition paths with {} relativePartitionPaths and partition predicates",
379+
log.debug("On {}, it took {} ms to list partition paths with {} relativePartitionPaths and partition predicates",
380380
metaClient.getTableConfig().getTableName(), timer.endTimer(), relativePartitionPaths.size());
381381
}
382382

@@ -398,7 +398,7 @@ protected List<PartitionPath> listPartitionPaths(List<String> relativePartitionP
398398
try {
399399
matchedPartitionPaths = tableMetadata.getPartitionPathWithPathPrefixes(relativePartitionPaths);
400400
} finally {
401-
log.info("On {}, it took {} ms to list partition paths with {} relativePartitionPaths",
401+
log.debug("On {}, it took {} ms to list partition paths with {} relativePartitionPaths",
402402
metaClient.getTableConfig().getTableName(), timer.endTimer(), relativePartitionPaths.size());
403403
}
404404
}
@@ -491,6 +491,12 @@ private List<StoragePathInfo> listPartitionPathFiles(List<PartitionPath> partiti
491491
Set<StoragePath> missingPartitionPaths =
492492
CollectionUtils.diffSet(partitionPaths, cachedPartitionPaths.keySet());
493493

494+
if (missingPartitionPaths.isEmpty()) {
495+
return cachedPartitionPaths.values().stream()
496+
.flatMap(Collection::stream)
497+
.collect(Collectors.toList());
498+
}
499+
494500
// NOTE: We're constructing a mapping of absolute form of the partition-path into
495501
// its relative one, such that we don't need to reconstruct these again later on
496502
Map<String, StoragePath> missingPartitionPathsMap = missingPartitionPaths.stream()
@@ -501,7 +507,7 @@ private List<StoragePathInfo> listPartitionPathFiles(List<PartitionPath> partiti
501507

502508
HoodieTimer timer = HoodieTimer.start();
503509
try {
504-
log.info("On {}, out of {} partition paths, {} are missing from cache. Loading them.",
510+
log.debug("On {}, out of {} partition paths, {} are missing from cache. Loading them.",
505511
metaClient.getTableConfig().getTableName(), partitionPaths.size(), missingPartitionPaths.size());
506512
Map<String, List<StoragePathInfo>> fetchedPartitionsMap;
507513
fetchedPartitionsMap = tableMetadata.getAllFilesInPartitions(
@@ -523,7 +529,7 @@ private List<StoragePathInfo> listPartitionPathFiles(List<PartitionPath> partiti
523529
} catch (IOException e) {
524530
throw new HoodieIOException("On " + metaClient.getTableConfig().getTableName() + " Failed to list partition paths", e);
525531
} finally {
526-
log.info("On {}, it took {} ms to fetch files for {} uncached partitions via getAllFilesInPartitions",
532+
log.debug("On {}, it took {} ms to fetch files for {} uncached partitions via getAllFilesInPartitions",
527533
metaClient.getTableConfig().getTableName(), timer.endTimer(), missingPartitionPaths.size());
528534
}
529535
}

0 commit comments

Comments
 (0)