Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12839

SlidingWindow with timeDifference zero fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • streams

    Description

      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]`.

       

      KIP-765 https://cwiki.apache.org/confluence/display/KAFKA/KIP-765%3A+Introduce+new+SlidingWindow+type+for+%5Bstart%2Cend%5D+time 

      Attachments

        Issue Links

          Activity

            People

              showuon Luke Chen
              mjsax Matthias J. Sax
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: