pabloem commented on a change in pull request #15549:
URL: https://github.com/apache/beam/pull/15549#discussion_r799897574
##########
File path:
sdks/java/io/redis/src/main/java/org/apache/beam/sdk/io/redis/RedisIO.java
##########
@@ -447,7 +388,7 @@ public void processElement(ProcessContext c) {
}
})
.withSideInputs(empty));
- return materialized.apply(Reshuffle.viaRandomKey());
+ return materialized.apply(Distinct.create());
Review comment:
Ok, let's update the documentation of the transform to indicate that
redis may output duplicates, and so we have an extra step to deduplicate them.
I think it makes sense to add an option `withAllowDuplicates` that increases
performance but may have duplicate elements in a single PCollection
Also, instead of `Distinct`, let's use `Latest.perKey()`
(https://beam.apache.org/documentation/transforms/java/aggregation/latest/)
--
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]