xushiyan commented on a change in pull request #4856:
URL: https://github.com/apache/hudi/pull/4856#discussion_r825536790



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/data/HoodieList.java
##########
@@ -132,6 +134,26 @@ public long count() {
     return HoodieList.of(new ArrayList<>(new HashSet<>(listData)));
   }
 
+  @Override
+  public <O> HoodieData<T> distinctWithKey(SerializableFunction<T, O> 
keyGetter, int parallelism) {
+    Set<O> set = listData.stream().map(i -> 
throwingMapWrapper(keyGetter).apply(i)).collect(Collectors.toSet());
+    List<T> distinctList = new LinkedList<>();
+    listData.forEach(x -> {
+      if (set.contains(throwingMapWrapper(keyGetter).apply(x))) {
+        distinctList.add(x);
+      }
+    });
+    return HoodieList.of(distinctList);

Review comment:
       fixed with new logic and filing a ticket for Flink/Java fix




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