Member since
02-03-2023
2
Posts
0
Kudos Received
0
Solutions
02-03-2023
06:29 AM
Hi all, I'm very new to NiFi and trying to find ways how to convert json array to be stored in SQL database. I currently have this input json {
"QueryHandle" : "#qb9ec959946924620a6f46013d745fe03",
"Rows" : [ {
"Values" : [ "A1", "Test Data A1" ]
}, {
"Values" : [ "A2", "Test Data A2" ]
}, {
"Values" : [ "A3", "Test Data A3" ]
}, {
"Values" : [ "A4", "Test Data A4" ]
} ],
"TotalRowCount" : 197,
"DataTypes" : {
"Values" : [ {
"ColumnName" : "Value",
"Type" : "String"
}, {
"ColumnName" : "Description",
"Type" : "String"
} ]
}
} Here's the end result I would like to have before I can use PutSQL processor [ {
"VALUES" : "A1",
"DESCRIPTION" : "Test Data A1"
}, {
"VALUES" : "A2",
"DESCRIPTION" : "Test Data A2"
}, {
"VALUES" : "A3",
"DESCRIPTION" : "Test Data A3",
}, {
"VALUES" : "A4",
"DESCRIPTION" : "Test Data A4",
} I have tried to use jolttransform, but couldn't be able to remove the array or to add the field name to the data. Eventually, I would like to see this in my DB VALUE DESCRIPTION A1 Test Data A1 A2 Test Data A2 A3 Test Data A3 A4 Test Data A4 Thank you in advance.
... View more
Labels:
- Labels:
-
Apache NiFi