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

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

                Author: ASF GitHub Bot
            Created on: 24/Sep/18 20:35
            Start Date: 24/Sep/18 20:35
    Worklog Time Spent: 10m 
      Work Description: HuangLED commented on a change in pull request #6439: 
[BEAM-5427] Fix and update sample code for CombineFn.
URL: https://github.com/apache/beam/pull/6439#discussion_r219978956
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/Combine.java
 ##########
 @@ -254,10 +254,26 @@ private Combine() {
    *
    * <pre>{@code
    * public class AverageFn extends CombineFn<Integer, AverageFn.Accum, 
Double> {
-   *   public static class Accum {
+   *   public static class Accum implements java.io.Serializable {
    *     int sum = 0;
    *     int count = 0;
+   *
+   *    {@literal@}Override
+   *     public boolean equals(Object other) {
 
 Review comment:
   If not overriding equals(), we get pages of warning messages saying:  
   > 'Coder of type class org.apache.beam.sdk.coders.KvCoder has a 
#structuralValue method which does not return true when the encoding of the 
elements is equal.' 

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


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

    Worklog Id:     (was: 147296)
    Time Spent: 2h 50m  (was: 2h 40m)

> Fix sample code (AverageFn) in Combine.java
> -------------------------------------------
>
>                 Key: BEAM-5427
>                 URL: https://issues.apache.org/jira/browse/BEAM-5427
>             Project: Beam
>          Issue Type: Improvement
>          Components: examples-java
>            Reporter: Ruoyun Huang
>            Assignee: Ruoyun Huang
>            Priority: Minor
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Sample code missing coder. 
> In its current state, job run fails with Coder missing error. 



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

Reply via email to