danny0405 commented on code in PR #17704:
URL: https://github.com/apache/hudi/pull/17704#discussion_r2660242610


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieFileGroup.java:
##########
@@ -96,7 +114,29 @@ public void addBaseFile(HoodieBaseFile dataFile) {
     if (!fileSlices.containsKey(dataFile.getCommitTime())) {
       fileSlices.put(dataFile.getCommitTime(), new FileSlice(fileGroupId, 
dataFile.getCommitTime()));
     }
-    fileSlices.get(dataFile.getCommitTime()).setBaseFile(dataFile);
+    FileSlice fileSlice = fileSlices.get(dataFile.getCommitTime());
+    Option<HoodieBaseFile> oldBaseFileOpt = fileSlice.getBaseFile();
+    if (!oldBaseFileOpt.isPresent()) {
+      fileSlice.setBaseFile(dataFile);
+    } else {
+      if (oldBaseFileOpt.get().getModifyTime() > 0 && dataFile.getModifyTime() 
> 0) {

Review Comment:
   The modification time is not reliable and could be changed after files 
migration, I'm wondering what's the file slice under the lsm layout, does it 
mean we just got 1 file slice for each file group?



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