Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How do I use Jolt to json array to nested json?
Labels:
- Labels:
-
Apache NiFi
New Contributor
Created 07-28-2021 04:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am new to NiFi (1.14) and trying to use the JOLTTransform processor to transform input json (flat) to nested json. Could not able to fix with JOLT Schema. kindly help me on this.
GetFile --->JOLTTranform-->PutFile
The Input Json is
[
{
"executionTime": "2244",
"processorId": "3ef03f9c-b42c-4c4e-9d5f-d14878bb2c84",
"filename": "Trading",
"processStartTime": "2021-07-26 16:31:19",
"processSQL": "TradingDetails.sql",
"executionFetchTime": "2049",
"sourceCountValue": "5076",
"startTime": "1627297279651",
"processGroupName": "Trading"
},
{
"ProcessEndTime": "2021-07-26 16:31:29",
"completedTime": "1627297289412",
"processDuration": "0",
"destCountValue": "5076",
"tableName": "TRADINGDETAILS"
},
{
"ProcessEndTime": "2021-07-26 16:31:29",
"completedTime": "1627297289412",
"processDuration": "0",
"destCountValue": "5076",
"tableName": "CUSTTRADINGDETAILS"
}
]
and the expected output json is
{
"Trading": {
"Source": {
"executionTime": "2244",
"processorId": "3ef03f9c-b42c-4c4e-9d5f-d14878bb2c84",
"filename": "Trading",
"processStartTime": "2021-07-26 16:31:19",
"processSQL": "TradingDetails.sql",
"executionFetchTime": "2049",
"sourceCountValue": "5076",
"startTime": "1627297279651",
"processGroupName": "Trading"
},
"Destination": {
"TRADINGDETAILS": {
"ProcessEndTime": "2021-07-26 16:31:29",
"completedTime": "1627297289412",
"processDuration": "10",
"destCountValue": "5076",
"tableName": "TRADINGDETAILS"
},
"CUSTTRADINGDETAILS": {
"ProcessEndTime": "2021-07-26 16:31:29",
"completedTime": "1627297289412",
"processDuration": "10",
"destCountValue": "5076",
"tableName": "CUSTTRADINGDETAILS"
}
}
}
}
Thanks in advance.
1 REPLY 1
Expert Contributor
Created 07-29-2021 11:53 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
This is not a NiFi problem, you may try to use some online tool to help
