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

KGroupedTable.aggregate(...) emits incorrect values

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.0
    • Fix Version/s: None
    • Component/s: streams
    • Labels:
      None

      Description

      I've run into what appears to be undesirable behaviour in a streams app.

      I have a KTable produced from a topic. The table contains entries like "abc1234/signal1" : 1, "abc1234/signal2" : 3
      The key is "id/signal name" and the value is an int. I want to produce a aggregate ktable containing the sum all of the
      signals for a given id.

      So if source ktable contains:

      ------------------+
      | abc1234/signal1 | 2 |
      | abc1234/signal2 | 4 |
      | abc4566/signal1 | 3 |
      ------------------+

      Then the output should contain

      ----------+
      | abc1234 | 6 |
      | abc4566 | 3 |
      ----------+

      On a change

      ------------------+
      | abc1234/signal1 | 3 |
      ------------------+
      ```
      I would expect the change
      ```
      ----------+
      | abc1234 | 7 |
      ----------+

      to be published.

      In fact there are two changelog entries published

      ----------+
      | abc1234 | 4 | // This is incorrect. The sum of the signals is never 4.
      ----------+

      Then

      ----------+
      | abc1234 | 7 |
      ----------+

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              neilgreen Neil Green
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: