Giter VIP home page Giter VIP logo

Comments (3)

mjsax avatar mjsax commented on May 9, 2024 1

The join happens here: https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamKStreamJoin.java#L88-L100

For a join, there is a windowed store for each input side that buffers all incoming records (this happens in an upstream processor: https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamJoinWindow.java#L64).

Additionally, each input record is used to so a lookup in the other store to find matching keys. The store lookup is basically the evaluation of the == predicate on the key plus the timestamp evaluation (cf. the otherWindow.fetch(key, timeFrom, timeTo) operation).

Before the join is done, Kafka Streams ensures that both input topics have the same number of partitions and that data is partitioned on the key. Thus, topic1-partition0 and topic2-partition-0 will contain the same keys and can be processed within a single thread.

Hope this helps.

from kafka-streams-examples.

mjsax avatar mjsax commented on May 9, 2024

The key comparison happens on the raw bytes -- thus, as long as both messages have the exact same serialized format they will be joined. What join are you interested in? KStream-KStream, KTable-KTable, or KStream-KTable?

from kafka-streams-examples.

victorchicu avatar victorchicu commented on May 9, 2024

KStream-KStream

from kafka-streams-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.