Reputation: 173
We have a use case wherein the business logic requires us to join tables from different databases and push the end result to an input topic.
table1 from schema1 in database1
table2 from schema2 in database2
Business logic
SELECT a,b FROM table1 INNER JOIN table2 ON table1.c = table2.d;
here a
is from table1
and b
is from table2
, and value of the message in the input topic looks like { "payload":{ "a":xyz,"b":xyz} }
Is there any way to achieve this requirement with a single jdbc source connector?
PS:
Upvotes: 0
Views: 1598
Reputation: 17
If both the databases are on the same Database Server you can use the CustomQuery and write the SQL joining the tables across database.
Upvotes: 0
Reputation: 32140
Short answer: No, you cannot use the JDBC Source connector in this way.
Longer answer: The JDBC source connector can connect to one database per connector instance. You have a few options:
query
option.Depending on data volumes and query complexity I'd personally go for option 1. ksqlDB is a perfect fit here.
Upvotes: 4