[ 
https://issues.apache.org/jira/browse/BEAM-5430?focusedWorklogId=149456&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-149456
 ]

ASF GitHub Bot logged work on BEAM-5430:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Sep/18 20:17
            Start Date: 28/Sep/18 20:17
    Worklog Time Spent: 10m 
      Work Description: aaltay closed pull request #6454: [BEAM-5430] Adjust 
implementation of CombineGroupedValues runner to use CombineFn.apply
URL: https://github.com/apache/beam/pull/6454
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/CombineRunners.java
 
b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/CombineRunners.java
index e2d21b71ac7..a306c042013 100644
--- 
a/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/CombineRunners.java
+++ 
b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/CombineRunners.java
@@ -225,12 +225,7 @@ void finishBundle() throws Exception {
                 
combinePayload.getCombineFn().getSpec().getPayload().toByteArray(), 
"CombineFn");
 
     return (KV<KeyT, Iterable<InputT>> input) -> {
-      AccumT accumulator = combineFn.createAccumulator();
-      Iterable<InputT> inputValues = input.getValue();
-      for (InputT inputValue : inputValues) {
-        accumulator = combineFn.addInput(accumulator, inputValue);
-      }
-      return KV.of(input.getKey(), combineFn.extractOutput(accumulator));
+      return KV.of(input.getKey(), combineFn.apply(input.getValue()));
     };
   }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 149456)
    Time Spent: 40m  (was: 0.5h)

> Adjust implementation of CombineGroupedValues runner to use CombineFn.apply
> ---------------------------------------------------------------------------
>
>                 Key: BEAM-5430
>                 URL: https://issues.apache.org/jira/browse/BEAM-5430
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-harness
>            Reporter: Daniel Oliveira
>            Assignee: Ruoyun Huang
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> In the [implementation for the runner of 
> Combine.GroupedValues|https://github.com/apache/beam/blob/bdd0081b49f8e7df6733dc8e8bc90dda3efc6621/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/CombineRunners.java#L217]
>  in the Java SDK it essentially re-implements what was already implemented in 
> [CombineFn.apply|https://github.com/apache/beam/blob/bdd0081b49f8e7df6733dc8e8bc90dda3efc6621/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java#L348].
> The implementation should instead just call CombineFn.apply for simplicity 
> and code reuse.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to