[ 
https://issues.apache.org/jira/browse/FLINK-2725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14950546#comment-14950546
 ] 

ASF GitHub Bot commented on FLINK-2725:
---------------------------------------

Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1191#discussion_r41641649
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/aggregation/SumAggregationFunction.java
 ---
    @@ -113,11 +182,32 @@ public Long getAggregate() {
                        return agg;
                }
        }
    -   
    +
    +   public static final class LongValueSumAgg extends 
SumAggregationFunction<LongValue> {
    +           private static final long serialVersionUID = 1L;
    +
    +           private long agg;
    +
    +           @Override
    +           public void initializeAggregate() {
    +                   agg = 0L;
    +           }
    +
    +           @Override
    +           public void aggregate(LongValue value) {
    +                   agg += value.getValue();
    +           }
    +
    +           @Override
    +           public LongValue getAggregate() {
    +                   return new LongValue(agg);
    +           }
    +   }
    +
        public static final class FloatSumAgg extends 
SumAggregationFunction<Float> {
                private static final long serialVersionUID = 1L;
    -           
    -           private float agg;
    +
    +           private double agg;
    --- End diff --
    
    The extra precision is beneficial when locally accumulating millions to 
billions of value considering the 23 bits of precision. Is there a performance 
advantage to using float over double and removing the implicit cast?


> Max/Min/Sum Aggregation of mutable types
> ----------------------------------------
>
>                 Key: FLINK-2725
>                 URL: https://issues.apache.org/jira/browse/FLINK-2725
>             Project: Flink
>          Issue Type: Improvement
>          Components: Java API
>    Affects Versions: 0.10
>            Reporter: Greg Hogan
>            Assignee: Greg Hogan
>            Priority: Minor
>
> Support mutable value types in min, max, and sum aggregations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to