kennknowles commented on code in PR #17818:
URL: https://github.com/apache/beam/pull/17818#discussion_r888443505


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java:
##########
@@ -1196,7 +1196,7 @@ public static <DestinationT> 
FileResultCoder<DestinationT> of(
 
     @Override
     public List<? extends Coder<?>> getCoderArguments() {
-      return Arrays.asList(windowCoder);
+      return Arrays.asList(windowCoder, destinationCoder);

Review Comment:
   You can see how it is used here: 
https://github.com/apache/beam/blob/243128a8fc52798e1b58b0cf1a271d95ee7aa241/sdks/java/core/src/main/java/org/apache/beam/sdk/coders/CoderRegistry.java#L723
   
   So if you have a `Coder<Foo<A, B, C>>` then the list of type arguments is 
`A, B, C` and `getCoderArguments` needs to return a `Coder<A>, Coder<B>, 
Coder<C>` that matches. So definitely before this pull request the coder 
registry will try to encode `DestinationT` with the window coder.
   
   Right now `FileResult` just holds the window without tracking the type 
variable for it. I think it would be a breaking change to make it 
`FileResult<WindowT, DestinationT>`. I think just changing the window coder to 
the destination coder is the right thing to do.



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