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?

https://docs.confluent.io/platform/current/connect/transforms/flatten.html#flatten

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”
}
}