kennknowles commented on a change in pull request #14854:
URL: https://github.com/apache/beam/pull/14854#discussion_r637254477



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/io/Read.java
##########
@@ -151,7 +150,8 @@ private Bounded(@Nullable String name, BoundedSource<T> 
source) {
           .apply(ParDo.of(new OutputSingleSource<>(source)))
           .setCoder(SerializableCoder.of(new 
TypeDescriptor<BoundedSource<T>>() {}))
           .apply(ParDo.of(new BoundedSourceAsSDFWrapperFn<>()))
-          .setCoder(source.getOutputCoder());
+          .setCoder(source.getOutputCoder())
+          
.setTypeDescriptor(source.getOutputCoder().getEncodedTypeDescriptor());

Review comment:
       Yes, the expected use of this method is to set the type descriptor but 
_not_ the coder. This way, the coder registry still can choose the coder.
   
   Setting both is redundant, in theory. Setting just the coder should suffice. 
Maybe some plumbing needed? It was not really expected to look at either one in 
this way.
   
   Another angle to consider is that type descriptor is Java-specific, while 
coder is the portable "type" of the data. I don't know if that matters here.




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