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

Support fetch(fromKey, toKey, from, to) to WindowRangeQuery and unify WindowKeyQuery and WindowRangeQuery

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 4.0.0
    • streams

    Description

      KIP-997: https://cwiki.apache.org/confluence/display/KAFKA/KIP-997%3A++Support+fetch%28fromKey%2C+toKey%2C+from%2C+to%29+to+WindowRangeQuery+and+unify+WindowKeyQuery+and+WindowRangeQuery

      We aim to enhance the WindowRangeQuery  by supporting a new method: fetch(keyFrom, keyTo, from, to). Currently, WindowRangeQuery  utilizes KeyValueIterator<Windowed<K>, V> fetchAll(Instant timeFrom, Instant timeTo)  for retrieving all key-value pairs within a specified time range. However, we propose to use KeyValueIterator<Windowed<K>, V> fetch(K keyFrom, K keyTo, Instant timeFrom, Instant timeTo)  instead. This new method will provide a KeyValueIterator<Windowed<K>, V>  that allows users to iterate over windowed key-value pairs {{

      {<Windowed<K>, value>}

      }} , spanning the entire time range.

      With this new method, users can retrieve window sessions for specific keys, rather than all keys, which enables a more targeted query. This is an improvement over the fetchAll  method, which only allows retrieval of all key's window sessions without the ability to specify a range of keys.

      Additionally, this enhancement also allows the WindowRangeQuery  to support WindowKeyQuery  functionality. Users seeking to query window sessions for a specific key can do so by setting keyFrom  and keyTo  to be equal. This dual functionality provides more flexibility and efficiency in querying windowed keys.

       

      Attachments

        Issue Links

          Activity

            People

              hanyuzheng Hanyu Zheng
              hanyuzheng Hanyu Zheng
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: