cuibo01 commented on code in PR #5545:
URL: https://github.com/apache/hudi/pull/5545#discussion_r868868607


##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/AbstractTableFileSystemView.java:
##########
@@ -644,14 +644,17 @@ public final Stream<FileSlice> 
getLatestUnCompactedFileSlices(String partitionSt
 
   @Override
   public final Stream<FileSlice> getLatestFileSlicesBeforeOrOn(String 
partitionStr, String maxCommitTime,
-      boolean includeFileSlicesInPendingCompaction) {
+      boolean includeFileSlicesInPendingCompaction, boolean 
includeFilesInPendingCompaction) {
     try {
       readLock.lock();
       String partitionPath = formatPartitionKey(partitionStr);
       ensurePartitionLoadedCorrectly(partitionPath);
       Stream<FileSlice> fileSliceStream = 
fetchLatestFileSlicesBeforeOrOn(partitionPath, maxCommitTime)
           .filter(slice -> 
!isFileGroupReplacedBeforeOrOn(slice.getFileGroupId(), maxCommitTime));
       if (includeFileSlicesInPendingCompaction) {
+        if (includeFilesInPendingCompaction) {
+          return fileSliceStream.map(this::addBootstrapBaseFileIfPresent);

Review Comment:
   thx for your review, @danny0405 
   from the TM log:
   2022-04-25 14:21:25,198 INFO  
org.apache.hudi.common.table.view.AbstractTableFileSystemView - Pending 
Compaction instant for (FileSlice 
{fileGroupId=HoodieFileGroupId{partitionPath='', 
fileId='02d71f2b-bb2f-4c44-96f2-78cb791da28e'}, baseCommitTime=20220425131449, 
baseFile='null', 
logFiles='[HoodieLogFile{pathStr='hdfs://hacluster/tmp/hudi/hudi_sink/.02d71f2b-bb2f-4c44-96f2-78cb791da28e_20220425131449.log.1_4-50-0',
 fileLen=20884490}]'}) **is 
:Option**{val=(20220425131449,CompactionOperation{baseInstantTime='20220425131251',
 dataFileCommitTime=Option{val=20220425131251}, 
deltaFileNames=[.02d71f2b-bb2f-4c44-96f2-78cb791da28e_20220425131251.log.1_4-50-0],
 
dataFileName=Option{val=02d71f2b-bb2f-4c44-96f2-78cb791da28e_8-10-0_20220425131251.parquet},
 id='HoodieFileGroupId{partitionPath='', 
fileId='02d71f2b-bb2f-4c44-96f2-78cb791da28e'}', metrics={TOTAL_LOG_FILES=1.0, 
TOTAL_IO_READ_MB=84.0, TOTAL_LOG_FILES_SIZE=2.2786803E7, 
TOTAL_IO_WRITE_MB=62.0, TOTAL_IO_MB=146.0}, bootstrapFilePath=Opt
 ional.empty})}
   2022-04-25 14:21:25,198 INFO  
org.apache.hudi.common.table.view.AbstractTableFileSystemView - File Slice 
(FileSlice {fileGroupId=HoodieFileGroupId{partitionPath='', 
fileId='02d71f2b-bb2f-4c44-96f2-78cb791da28e'}, baseCommitTime=20220425131449, 
baseFile='null', 
logFiles='[HoodieLogFile{pathStr='hdfs://hacluster/tmp/hudi/hudi_sink/.02d71f2b-bb2f-4c44-96f2-78cb791da28e_20220425131449.log.1_4-50-0',
 fileLen=20884490}]'}) is in pending compaction



-- 
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]

Reply via email to