lct45 commented on a change in pull request #9157: URL: https://github.com/apache/kafka/pull/9157#discussion_r481375834
########## File path: streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamSlidingWindowAggregate.java ########## @@ -164,11 +161,13 @@ public void processInOrder(final K key, final V value, final long timestamp) { if (endTime < timestamp) { leftWinAgg = next.value; - if (isLeftWindow(next)) { - latestLeftTypeWindow = next.key.window(); - } + // update to store the previous record Review comment: I'm not sure we need to check that, I think that by the nature of going through windows forward, the next window we find will always have a max timestamp that's larger than the previous window. Right? Lemme do an example: Record comes in @30, previous record was at @23, timeDifference = 10. The last window we find with an endTime < timestamp will be 23's left window, where the max record value is 23. Any earlier windows with endTime < timestamp will have a max value less than 23, so we can override them safely ---------------------------------------------------------------- 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