flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sunjincheng (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-7101) Fix Non-windowed group-aggregate error when using `minIdleStateRetentionTime` config and retract agg
Date Tue, 04 Jul 2017 12:37:01 GMT
sunjincheng created FLINK-7101:
----------------------------------

             Summary: Fix Non-windowed group-aggregate error when using `minIdleStateRetentionTime`
config and retract agg
                 Key: FLINK-7101
                 URL: https://issues.apache.org/jira/browse/FLINK-7101
             Project: Flink
          Issue Type: Bug
          Components: Table API & SQL
    Affects Versions: 1.3.1, 1.3.0
            Reporter: sunjincheng
            Assignee: sunjincheng
             Fix For: 1.4.0


When Non-windowed group-aggregate using {{minIdleStateRetentionTime}} config and retract AGG,
Will emit "NULL" agg value which we do not expect. 
For example: ({{IntSumWithRetractAggFunction}})
1. Receive: CRow(Row.of(6L: JLong, 5: JInt, "aaa"), true) 
2. Cleanup state
3. Receive: CRow(Row.of(6L: JLong, 5: JInt, "aaa"), false)  // acc.f1 = -1, getValue= null


So, we must change the logic of {{GroupAggProcessFunction}} as follows:
{code}
if (inputCnt != 0) {
     ...
    } else {
     ...
    }
{code}
TO
{code}
if (inputCnt > 0) {
     ...
    } else {
    if( null != prevRow.row){
     ...
     }
    }
{code}
What do you think? [~fhueske] [~hequn8128]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message