How to read JSON file with multiple arrays in a node

Highlighted
Six Stars

How to read JSON file with multiple arrays in a node

I am using Talend for BigData 6.3.1 and trying to read JSON file with below format using tFileInputJSON(JsonPath without Loop) and tExtractJSONFields(XPath). I am able to extract records up to one level but unable to split it further. Now I need help to extract data under the fields rows, cells and field_def. 

 

Sample.json

{
columns {}
top_level_rows [1,2,...10]
rows:{
1 {
ref
child_refs -- empty array []
id
}
....
10 {
ref
parent_ref
child_refs
id
}
}
cells
[[ --(embedded array [])
[[
{
id
value
id
name
row
},
....
{
id
value
id
name
row
}
]],
[[
{
id
value
id
name
row
},
....
{
id
value
id
name
row
}
]],, ....
]]
field_def:
{
11: {
ref
table
}
.....
20: {
ref
table
}
}
}

 

I am new to Talend and need help to proceed. I googled a lot but unable to find anything for such scenarios.

 

Regards,

Keerthi


Accepted Solutions
Six Stars

Re: How to read JSON file with multiple arrays in a node

Thanks Sabrina. This link help me to understand further.

 

Perfect solution I was looking for is in https://community.talend.com/t5/Design-and-Development/Parsing-JSON-with-tExtractJSONFields/m-p/1596...

 

Just posting here so that it might help others


All Replies
Moderator

Re: How to read JSON file with multiple arrays in a node

Hello,

Please try to two tExtractJSONField components in your job design.

Could you please take a look at this topic about:https://community.talend.com/t5/Design-and-Development/JSON-Array-values-to-Rows-is-there-a-better-w... to see if it is OK with your use case?

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: How to read JSON file with multiple arrays in a node

Thanks Sabrina. This link help me to understand further.

 

Perfect solution I was looking for is in https://community.talend.com/t5/Design-and-Development/Parsing-JSON-with-tExtractJSONFields/m-p/1596...

 

Just posting here so that it might help others

Community Manager

Re: How to read JSON file with multiple arrays in a node

Thanks for cross-referencing and posting the solution

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

How to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud reg...

Learn how to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud registries

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend API Services Publish to Talend Cloud

Learn how to publish your API Services to Talend Cloud

Watch Now