leonardBang commented on a change in pull request #14863: URL: https://github.com/apache/flink/pull/14863#discussion_r579912160
########## File path: flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/deduplicate/DeduplicateFunctionHelper.java ########## @@ -96,12 +109,20 @@ static void processLastRowOnChangelog( currentRow.setRowKind(RowKind.INSERT); out.collect(currentRow); } else { - if (generateUpdateBefore) { - preRow.setRowKind(RowKind.UPDATE_BEFORE); - out.collect(preRow); + if (!isStateTtlEnabled && equaliser.equals(preRow, currentRow)) { + // currentRow is the same as preRow and state cleaning is not enabled. + // We do not emit retraction and update message. + // If state cleaning is enabled, we have to emit messages to prevent too early + // state eviction of downstream operators. Review comment: Got it, make sense to me ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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