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

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

Github user shaoxuan-wang commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3470#discussion_r104411239
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/aggfunctions/AvgAggFunction.scala
 ---
    @@ -321,12 +317,11 @@ class DecimalAvgAggFunction extends 
AggregateFunction[BigDecimal] {
         if (value != null) {
           val v = value.asInstanceOf[BigDecimal]
           val accum = accumulator.asInstanceOf[DecimalAvgAccumulator]
    +      accum.f0 = accum.f0.subtract(v)
    +      accum.f1 -= 1L
           if (accum.f1 == 0) {
    --- End diff --
    
    This was intent to accommodate the "AggFunctionTestBase" for BigDecimal 
comparison (BigDecimal equals not only cares value but also the scale).  I 
overlooked that we can use bigDecimal.compareTo to compare the values. Will 
remove this and change the test cases.


> Add retract method into the aggregateFunction
> ---------------------------------------------
>
>                 Key: FLINK-5956
>                 URL: https://issues.apache.org/jira/browse/FLINK-5956
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: Shaoxuan Wang
>            Assignee: Shaoxuan Wang
>
> Retraction method is help for processing updated message. It will also very 
> helpful for window Aggregation. This PR will first add retraction methods 
> into the aggregateFunctions, such that on-going over window Aggregation can 
> get benefit from it.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to