kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Roesler <j...@confluent.io>
Subject Re: Behaviour of KStreamKTableJoinProcessor
Date Mon, 15 Jul 2019 15:48:13 GMT
Hi Ties,

You're on the right track. You need to use `KTable.map` ahead of the
join to select the new key. This will allow Streams to make sure the
data is correctly partitioned to perform the join.


On Mon, Jul 15, 2019 at 10:07 AM Ven, Ties Jens van de
<ties.van.de.ven@alliander.com> wrote:
> I recently started working with kafka streams and I noticed some odd behavior.
> I was using a KTable left join with a null key, and ofcourse this will not work, since
it will join based on keys.
> But I also supplied a KeyValueMapper, which takes a property from the value and returns
this as key, and uses this value to join.
> It turns out that in the code, it firsts checks if there is a null key, and if so, it
> Would it be more logical to check the result of the keyMapper for null instead of the
actual key?
> https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamKTableJoinProcessor.java
> Kind regards
> Ties

View raw message