Matthias J. Sax created KAFKA-12839:
---------------------------------------

             Summary: SlidingWindow with size 0 fails
                 Key: KAFKA-12839
                 URL: https://issues.apache.org/jira/browse/KAFKA-12839
             Project: Kafka
          Issue Type: Bug
          Components: streams
            Reporter: Matthias J. Sax


Trying to use a sliding window with time-difference 0 (that is officially 
supported) fails with an exception and Kafka Stream crashes with

{{IllegalArgumentException: Window endMs must be greater than window startMs}}

The underlying issue is the usage of {{TimeWindow}} to represent the window 
what is incorrect.

{{TimeWindow}} is designed for hopping/tumbling windows with an inclusive lower 
and exclusive upper bound. Thus, the upper bound must be larger than the lower 
bound, because otherwise the window would have a negative size what is not 
allowed.

For sliding windows, we use include lower and upper bound though, and thus want 
to set upper and lower bound to be the same, what would still result in a 
window of size 1 (note that time-difference of 0 results in window size 1).

It seems we need to introduce a new {{SlidingWindow}} type.

Note, that for a non-zero time-difference, the window bounds are computed 
"correctly", however, {{TimeWindow}} is still an incorrect representation 
because it represents `[start,end)` instead of `[start,end]`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to