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

Auto create through topic for KStream aggregation and join

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.1.0
    • Component/s: streams
    • Labels:

      Description

      For KStream.join / aggregateByKey operations that requires the streams to be partitioned on the record key, today users should repartition themselves through the "through" call:

      stream1 = builder.stream("topic1");
      stream2 = builder.stream("topic2");
      
      stream3 = stream1.map(/* set the right key for join*/).through("topic3");
      stream4 = stream2.map(/* set the right key for join*/).through("topic4");
      
      stream3.join(stream4, ..)
      

      This pattern can actually be done by the Streams DSL itself instead of requiring users to specify themselves, i.e. users can just set the right key like (see KAFKA-3430) and then call join, which will be translated by adding the "internal topic for repartition".

      Another thing is that today if user do not call "through" after setting a new key, the aggregation result would not be correct as the aggregation is based on key B while the source partitions is partitioned by key A and hence each task will only get a partial aggregation for all keys. But this is not validated in the DSL today. We should do both the auto-translation and validation.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              damianguy Damian Guy
              Reporter:
              guozhang Guozhang Wang

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment