Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

To achieve complex json value ie. implement an array json using JolttransformJson process in nifi.

Highlighted

To achieve complex json value ie. implement an array json using JolttransformJson process in nifi.

New Contributor

We want to achieve an complex json value ie. implement an array json using JolttransformJson.

 

I have a Csv like:

Sno,Name,Mobile_1,Mobile_2
1,Ashick11,1111,2222
2,Mani12,3333,4444
3,Suresh,5555,6666

 

I want to Combine "Mobile_1" and "Mobile_2" values as "Mobile" as in array.

 

My Json Spec is:

[
{
"operation": "shift",
"spec": {
"mobile1": "Mobile[0].mobile1"
}
},
{
"operation": "default",
"spec": {
"Sno":"${Sno}",
"Name":"${Name}",
"Mobile[]": {
"*": {
"Mobile1":"${name}",
"address":"${address}"
}
}
}
}
]

 

But still Json output is not produced for "Mobile_1" and "Mobile_2" field, the step is not throwing error also. it just giving me json value for "Sno" and "Names".

@mburgess Please let us know what are we doing wrong and let know how to implement the Mobile_1 and Mobile_2 values in "Mobile" as in array?

 

Don't have an account?
Coming from Hortonworks? Activate your account here