Christopher Meier created KAFKA-14268:
-----------------------------------------

             Summary: When aggregating on a KGroupedStream allow an 
InitializerWithKey
                 Key: KAFKA-14268
                 URL: https://issues.apache.org/jira/browse/KAFKA-14268
             Project: Kafka
          Issue Type: Improvement
          Components: streams
            Reporter: Christopher Meier


Sometimes when aggregating on a KGroupedStream I would like to have an initial 
value which change depending on the key.

A workarround is to have a dummy value in the initializer which can be checked 
for and replaced in the aggregator, but that implies some performance loss 
caused by the check.

My proposal is to add yet another overload for {{aggregate}} which has instead 
of an {{Initializer}} an {{{}InitializerWithKey{}}}. The {{apply}} method of 
{{InitializerWithKey}} would have the key as input and the initial value as 
output.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to