danny0405 commented on code in PR #9923:
URL: https://github.com/apache/hudi/pull/9923#discussion_r1373980115
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/IncrementalInputSplits.java:
##########
@@ -447,14 +448,14 @@ private List<MergeOnReadInputSplit> getInputSplits(
.filter(logPath ->
!logPath.endsWith(HoodieCDCUtils.CDC_LOGFILE_SUFFIX))
.collect(Collectors.toList()));
String basePath =
fileSlice.getBaseFile().map(BaseFile::getPath).orElse(null);
- String sliceLastInstant =
fileSlice.getLatestLogFile().isPresent()
- ? fileSlice.getLatestLogFile().get().getDeltaCommitTime()
- : fileSlice.getBaseInstantTime();
+ String fileSliceLastestInstant =
HoodieTimeline.minInstant(fileSlice.getLatestLogFile().map(HoodieLogFile::getDeltaCommitTime)
+ .orElse(fileSlice.getBaseInstantTime()), endInstant);
Review Comment:
Caution that the max delta commit time may be less than the base instant
time, and it could cause data loss after your change, you need to get the
min(max_instant(max_delta_instant, base_instant), endInstant).
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/IncrementalInputSplits.java:
##########
@@ -447,14 +448,14 @@ private List<MergeOnReadInputSplit> getInputSplits(
.filter(logPath ->
!logPath.endsWith(HoodieCDCUtils.CDC_LOGFILE_SUFFIX))
.collect(Collectors.toList()));
String basePath =
fileSlice.getBaseFile().map(BaseFile::getPath).orElse(null);
- String sliceLastInstant =
fileSlice.getLatestLogFile().isPresent()
- ? fileSlice.getLatestLogFile().get().getDeltaCommitTime()
- : fileSlice.getBaseInstantTime();
+ String fileSliceLastestInstant =
HoodieTimeline.minInstant(fileSlice.getLatestLogFile().map(HoodieLogFile::getDeltaCommitTime)
+ .orElse(fileSlice.getBaseInstantTime()), endInstant);
Review Comment:
Caution that the max delta commit time may be less than the base instant
time, and it could cause data loss after your change, you need to get the
min(max(max_delta_instant, base_instant), endInstant).
--
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]