I'm configuring Kafka Connect to copy data from Kafka to Database
I need to put value from some field to two column in Database .
My Kafka Message has two fields name, age. Target table has 3 columns name, displayName and age. I would like to clone value of name from Kafka message to put it in both columns name and displayName.
Is there any Transform, that can by applied to do that?
As Driss Nejjar says, this would typically be the kind of thing that a Single Message Transform would be perfect for. However, there is no Transform that ships with Apache Kafka that I can see that would do this. You could write your own, or you could also use KSQL:
CREATE STREAM new AS SELECT name, name as displayName, age FROM source;
This would take your source topic (populated by Connect), and add the additional field displayName, and write to a new Kafka topic called new.
Disclaimer: I work for Confluent, the company behind the KSQL project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With