DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
In KIP-149, we introduced ValueJoinerWithKey interface for Kafka Streams DSL. Its intent is to give the joiner access to the join key, so users can write joiners whose output depends on the key, not just the values. Its The underlying implementation has KStreamKTableJoinProcessor that is used for shared by both streamsstream-table and streamsstream-globalTable join’s processorjoins.
For stream-table joins, the join key is the stream record's key, so the processor works correctly. For stream-globalTable joins, the join key is computed from the stream record via a user-supplied KeyValueMapper and is generally different from the stream record's key. However, the current KStreamKTableJoinProcessor#doJoin implementation passes the stream record's key into ValueJoinerWithKey.apply(), not the mapped join key.
...
The existing KStream.join(GlobalKTable, KeyValueMapper, ValueJoinerWithKey) and KStream.leftJoin(GlobalKTable, KeyValueMapper, ValueJoinerWithKey) overloads are retained for backwards compatibility. They continue to pass the stream record's key into the joiner, but marked as @deprecated@Deprecated, and targeted to be removed at a future major release.releas
| Code Block |
|---|
@Deprecated
<GlobalKey, GlobalValue, VOut> KStream<K, VOut> join(
final GlobalKTable<GlobalKey, GlobalValue> globalTable,
final KeyValueMapper<? super K, ? super V, ? extends GlobalKey> keySelector,
final ValueJoinerWithKey<? super K, ? super V, ? super GlobalValue, ? extends VOut> joiner
)
@Deprecated
<GlobalKey, GlobalValue, VOut> KStream<K, VOut> join(
final GlobalKTable<GlobalKey, GlobalValue> globalTable,
final KeyValueMapper<? super K, ? super V, ? extends GlobalKey> keySelector,
final ValueJoinerWithKey<? super K, ? super V, ? super GlobalValue, ? extends VOut> joiner,
final Named named
)
@Deprecated
<GlobalKey, GlobalValue, VOut> KStream<K, VOut> leftJoin(
final GlobalKTable<GlobalKey, GlobalValue> globalTable,
final KeyValueMapper<? super K, ? super V, ? extends GlobalKey> keySelector,
final ValueJoinerWithKey<? super K, ? super V, ? super GlobalValue, ? extends VOut> joiner
)
@Deprecated
<GlobalKey, GlobalValue, VOut> KStream<K, VOut> leftJoin(
final GlobalKTable<GlobalKey, GlobalValue> globalTable,
final KeyValueMapper<? super K, ? super V, ? extends GlobalKey> keySelector,
final ValueJoinerWithKey<? super K, ? super V, ? super GlobalValue, ? extends VOut> joiner,
final Named named
) |
...
The new overloads would differ from the existing ones only in the generic parameterization of ValueJoinerWithKey (the first type parameter would bind to the mapped key type instead of the stream key type). After type erasure, both have identical signatures, and Java rejects them as duplicate method declarations.
Add a new functional interface exposing both the stream key and the mapped key
Would require introducing a new ValueJoinerWithKeys interface accepting both keys. Rejected for this KIP, whose scope is limited to honoring KIP-149's existing readOnlyKey contract. It can be revisited as a separate KIP if demand emerges