zhangyue19921010 commented on code in PR #17704:
URL: https://github.com/apache/hudi/pull/17704#discussion_r2660435935
##########
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:
Ops, This change is not LSM related and just a quick fix for Spark dirty
files caused by speculative execution.
Regarding the LSM file layout, the hierarchies of File Group, File Slice,
and LogFile follow the current design. The difference is that all Log files in
LSM use parquet, and there is no Base File in a single File Slice; instead,
only Log Files are used.
--
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]