You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/02 20:52:38 UTC

[GitHub] [beam] kennknowles commented on a diff in pull request #17818: [BEAM-14553] Add destination coder to FileResultCoder components

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


##########
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:
   It seems to me that both versions are wrong and it should be `ImmutableList.of(destinationCoder)`.
   
   The javadoc:
   
   ```
   /**
      * If this is a {@link Coder} for a parameterized type, returns the list of {@link Coder}s being
      * used for each of the parameters in the same order they appear within the parameterized type's
      * type signature. If this cannot be done, or this {@link Coder} does not encode/decode a
      * parameterized type, returns the empty list.
      */
   ```
   
   This means that since it is a `Coder<FileResult<DestinationT>>` that the return value from `getCoderArguments` should line up with `DestinationT`.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org