y1chi commented on a change in pull request #13225:
URL: https://github.com/apache/beam/pull/13225#discussion_r514645265



##########
File path: 
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/SdkComponents.java
##########
@@ -264,10 +264,18 @@ public String registerCoder(Coder<?> coder) throws 
IOException {
     if (existing != null) {
       return existing;
     }
+    // Unlike StructuredCoder, custom coders may not have proper 
implementation of hashCode() and
+    // equals(), this lead to unnecessary duplications. In order to avoid this 
we examine already
+    // registered coders and see if we can find a matching proto, and consider 
them same coder.
+    RunnerApi.Coder coderProto = CoderTranslation.toProto(coder, this);
+    for (Map.Entry<String, RunnerApi.Coder> entry : 
componentsBuilder.getCodersMap().entrySet()) {

Review comment:
       done.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to