I read this doc where it said stream / table join must have same partitions number on both side.
But I have this topics and partitions, and the code still works, no exception thrown.
kafka-topics.sh --bootstrap-server localhost:9092 --create --partitions 5 --replication-factor 1 --topic t-left
kafka-topics.sh --bootstrap-server localhost:9092 --create --partitions 2 --replication-factor 1 --topic t-right --config "cleanup.policy=compact"
So the left (stream) has 5 partitions, and the right (table) has 2 partitions only.
From the documentation, I thought some error will happen in this code. I get Invalid topology
when trying to joins stream / stream with different partitions count, so I thought will have same Invalid topology
error, which is not.
var leftStream = builder.stream("t-left");
var rightTable = builder.table("t-right");
// join
var joinStream = rightStream.join(leftTable, this::joiner,
Joined.with(stringSerde, stringSerde, stringSerde));
joinStream.to("t-join", Produced.with(stringSerde, stringSerde));
And the join also happened at t-join
.
How can this happened?