JDBC source connector support for JSON nested structure

We are trying to use JDBC source connector with nested JSON structures (to read SQL Server CDC data using Kafka Connect).

But as per the examples we came across & tried, found that the JDBC connector supports flat Json structure only.

We thus tried creating nested Json in DB and pulled the same through the connector. But JDBC connector treats this as “string”, which then doesn’t allow Json schema versioning.

Can anyone help me with how to use the JDBC source connector with nested JSON structures?

Thanks in advance,
Bhushan.

@Bhushan.patil could using the Flatten SMT help with your objective?

Hi Rick,

Thanks for adding the comment, Checked the shared link, but flatten is converting nested Json into flat Json, But in my case, at the source connect end I want exactly the opposite flat JSON to nested Nested JSON.

Example,

Before
{
“id”: 42,
“first”: “David”,
“middle”: null,
“last”: “Wong”
}

After
{
“id”: 42,
“name”: {
“first”: “David”,
“middle”: null,
“last”: “Wong”
}
}

I need this as well.
Did you ever get this figured out?

Hi, I am also looking for this. Trying to fetch the json column from table and connect is adding extra "s when it is written to topic. I want it to be written as nested JSON structure. Anyone succeeded in this regard?