danny0405 commented on code in PR #18408:
URL: https://github.com/apache/hudi/pull/18408#discussion_r3007012038
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/versioning/v1/ArchivedTimelineV1.java:
##########
@@ -320,8 +320,10 @@ private InstantsLoader(boolean loadInstantDetails) {
public void accept(String instantTime, GenericRecord record) {
Option<HoodieInstant> instant = readCommit(instantTime, record,
loadInstantDetails, null);
if (instant.isPresent()) {
- instantsInRange.computeIfAbsent(instant.get().requestedTime(), s ->
new ArrayList<>())
- .add(instant.get());
+ List<HoodieInstant> instantsForTime =
instantsInRange.computeIfAbsent(instant.get().requestedTime(), s -> new
ArrayList<>());
+ if (!instantsForTime.contains(instant.get())) {
+ instantsForTime.add(instant.get());
Review Comment:
should we use `TreeSet` to keep the lookup efficient.
--
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]