lokeshj1703 commented on code in PR #11440:
URL: https://github.com/apache/hudi/pull/11440#discussion_r1681470626
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanActionExecutor.java:
##########
@@ -149,17 +150,24 @@ HoodieCleanerPlan requestClean(HoodieEngineContext
context) {
.map(x -> new HoodieActionInstant(x.getTimestamp(), x.getAction(),
x.getState().name())).orElse(null),
planner.getLastCompletedCommitTimestamp(),
config.getCleanerPolicy().name(), Collections.emptyMap(),
- CleanPlanner.LATEST_CLEAN_PLAN_VERSION, cleanOps,
partitionsToDelete, prepareExtraMetadata(planner.getSavepointedTimestamps()));
+ CleanPlanner.LATEST_CLEAN_PLAN_VERSION, cleanOps,
partitionsToDelete, prepareExtraMetadata(planner.getSavepointedTimestamps(),
planner.getEarliestSavepoint()));
} catch (IOException e) {
throw new HoodieIOException("Failed to schedule clean operation", e);
}
}
- private Map<String, String> prepareExtraMetadata(List<String>
savepointedTimestamps) {
- if (savepointedTimestamps.isEmpty()) {
+ private Map<String, String> prepareExtraMetadata(List<String>
savepointedTimestamps, Option<String> earliestSavepoint) {
+ if (savepointedTimestamps.isEmpty() && !earliestSavepoint.isPresent()) {
return Collections.emptyMap();
} else {
- return Collections.singletonMap(SAVEPOINTED_TIMESTAMPS,
savepointedTimestamps.stream().collect(Collectors.joining(",")));
+ Map<String, String> extraMetadata = new HashMap<>();
+ if (!savepointedTimestamps.isEmpty()) {
+ extraMetadata.put(SAVEPOINTED_TIMESTAMPS,
savepointedTimestamps.stream().collect(Collectors.joining(",")));
Review Comment:
Addressed
--
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]