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 2020/08/31 18:02:51 UTC

[GitHub] [beam] boyuanzz commented on a change in pull request #12724: Only encoding element residual when it's not null.

boyuanzz commented on a change in pull request #12724:
URL: https://github.com/apache/beam/pull/12724#discussion_r480296260



##########
File path: sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java
##########
@@ -1642,43 +1642,45 @@ public Object restriction() {
               .build());
     }
 
-    ByteString.Output primaryBytes = ByteString.newOutput();
-    ByteString.Output residualBytes = ByteString.newOutput();
-    try {
-      fullInputCoder.encode(windowedSplitResult.getPrimarySplitRoot(), primaryBytes);
-      fullInputCoder.encode(windowedSplitResult.getResidualSplitRoot(), residualBytes);
-    } catch (IOException e) {
-      throw new RuntimeException(e);
+    if (windowedSplitResult.getResidualSplitRoot() != null) {

Review comment:
       `windowedSplitResult` can be null and it has been checked above https://github.com/apache/beam/blob/master/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/FnApiDoFnRunner.java#L1579-L1588.
   
   I'm working on a refactor https://github.com/apache/beam/pull/12710, which will provide much more test coverage. Sorry for the inconvenience.




----------------------------------------------------------------
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:
users@infra.apache.org