I have a list of JSON objects, converted from the result of a SQL query. The JSON looks like this:
[ {
"CREATE_DATE_TIME" : "2018-02-04 11:00:03.0",
"EXTERNAL_ID" : "1111",
"CERT_NUMBER" : "123",
"DESCRIPTION" : "DESC 1",
"SOURCE_SYSTEM" : "WOULDIWAS"
}, {
"CREATE_DATE_TIME" : "2018-03-01 11:25:03.0",
"EXTERNAL_ID" : "2222",
"CERT_NUMBER" : "456",
"DESCRIPTION" : "DESC 2",
"SOURCE_SYSTEM" : "SHOOKSPEARE"
},
...
]
The output after JSON transform should be something like this:
{
"Jobs": [
{
"Notification": {
"ActivityDate" : "2018-02-04 11:00:03.0",
"ExternalId" : "1111",
"CertNum" : "123",
"Description" : "DESC 1",
"SourceSystem" : "WOULDIWAS",
"RecordType" : "Task Notification"
}, {
"Notification": {
"ActivityDate" : "2018-03-01 11:25:03.0",
"ExternalId" : "2222",
"CertNum" : "456",
"Description" : "DESC 2",
"SourceSystem" : "SHOOKSPEARE",
"RecordType" : "Task Notification"
},
...
]
}
(The RecordType is a literal string, not derived from the input JSON)
Each row / entry (JSON object enclosed in {}) in the input JSON is guaranteed to be unique but there is no key here that would indicate that. The row / entry in the input should correspond 1-1 to { Notification: {...} }
in the output. How should I construct my Jolt Spec to do this?