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.

Thanks,
-John

On Mon, Jul 15, 2019 at 10:07 AM Ven, Ties Jens van de
<ties.van.de....@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 skips.
> 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

Reply via email to