As i understand from this article Real-Time Data Enrichment with Kafka Streams: Introducing Foreign-Key Joins the foreign key join algorithm is using hashing on the left table value.
My question is what happens if the value schema of the left table is changed, can it influences the join?
we are using foreign key join in our code between two tables and it stops working properly. when we update the right table (account tables)nothing is triggered, although there is a matching account in the customer table.
It is fixed after we update the left table(customer table).
I noticed that there was a schema change in the left table value and i wonder if it may be the source of the problem.
fun joinCustomerAndAccount(
customersTable: KTable<CustomerKey, CustomerAddressPhoneDrivingLicenseJoin>,
accountsTable: KTable<AccountKey, Account>
): KTable<CustomerKey, CustomerAccountJoin> =
customersTable.leftJoin(
accountsTable,
{ customer -> AccountKey(customer.customer.userId.orElse(-1)) },
{ customer, account ->
CustomerAccountJoin.newBuilder().apply {
this.customer = customer.customer
this.address = customer.address.orElse(null)
this.phone = customer.phone.orElse(null)
this.drivingLicense = customer.drivingLicense.orElse(null)
this.account = account
}.build()
},
materializedAs(Stores.CUSTOMER_ACCOUNTS)
)