Member since
04-23-2021
2
Posts
0
Kudos Received
0
Solutions
09-06-2022
01:33 PM
I am trying to understand simple jolt transformations My original json { "name" : "john", "Address2" : "123 Street 1", "Address1" : "Apt 101", "custId" : "ZY-1234", "zip" : "67834" } I would like to change the sequence of columns and get comma separated values with default tags added to it, like below The last column value should be defaulted to current datetime { "Rows" : [ { "values" : [ "ZY-1234" , "john" , "123 Street 1","Apt 101","67834","2022-09-01 10:10:09" ] } ], "operationType" : "Insert", "Source" : "Dev" } here is the Spec I got to [ { "operation": "default", "spec": { "ChangedBy": "NIFI", "ChangedOn": "${now()}" } }, { "operation": "shift", "spec": { "*": { "@": "Rows[#1].Value" } } }, { "operation": "default", "spec": { "*": { "*": "&" }, "operationType": "Insert", "Source": "Dev" } } ] The Result of this { "Rows" : [ { "Values" : [ "john", "123 Street 1", "Apt 101", "ZY-1234", "67834", "NIFI", "${now()}" ] } ], "operationType" : "Insert", "Source" : "Dev" } Issues : 1. How to change the column sequence in Values array 2. How to get current datetime
... View more
Labels:
- Labels:
-
Apache NiFi