Is there a way to create a stream from a topic specifying that the entire record should be considered a VARCHAR so that I can create streams from it using extractjsonfield()? Sample records might looks something like:
{
"Header": {
"RecType": "RecA",
... more header records in a fairly consistent format ...
},
"RAFld1": {
"someFld": "some data",
"someOtherField": 1.001,
},
"RAFld2": {
"aFld": "data",
"anotherFld": 98.6,
...
},
...
}
But the next record might look like:
{
"Header": {
"RecType": "RecB",
... more header records in a fairly consistent format ...
},
"RBFld1": {
"randomFld": "random data",
"randomOtherField": 1.001,
...
}
}
I can work out how to define the initial stream with known fields as type VARCHAR and then extractjsonfield() (with an appropriate where clause), but don't see a way to say that the top level structure does not have consistently named fields.
This is the way my input topic is formatted; I can't change that format. I was hopeful that KSQL was going to be an elegant solution, but I looks like I'm stuck right from the start by not being able to handle this dynamic structure.