5herhom commented on code in PR #6254:
URL: https://github.com/apache/hudi/pull/6254#discussion_r939466034


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieCopyOnWriteTableInputFormat.java:
##########
@@ -254,6 +260,8 @@ private List<FileStatus> listStatusForSnapshotMode(JobConf 
job,
               .stream()
               .flatMap(Collection::stream)
               .map(fileSlice -> createFileStatusUnchecked(fileSlice, 
fileIndex, virtualKeyInfoOpt))
+              .filter(FileStatusOpt -> FileStatusOpt.isPresent())

Review Comment:
   > Instead of changing the API of the `createFileStatusUnchecked`, let's just 
move up this filtering to be preceding its invocation
   
   Do you mean that add an api `checkIfValidFileSlice` before 
createFileStatusUnchecked to filter the fileSlice like below
   `
   PartitionedFileSlices.values()
                 .stream()
                 .flatMap(Collection::stream)
                 .filter(fileSlice -> checkIfValidFileSlice(fileSclice))
                 .map(fileSlice -> createFileStatusUnchecked(fileSlice, 
fileIndex, virtualKeyInfoOpt))
   `
   In `checkIfValidFileSlice` to check the 3 condition of fileSlice : (1) has 
baseFile: return ture ; (2) has logFile and hasn't baseFile: return false ; (3) 
hasn't file : throw exception.
   



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