Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We're starting to work quite a bit with more complex JSON structures, IE multiple nested arrays etc... typically we're creating these from relational data sources and shredding them back into that.
I was just using an approach of chaining tWriteJsonField or tExtractJSONField to create them, is there a better way to do so?
Which gets me what I want,
[
{
"KEY": "1",
"COL_TWO": "ROOT_RECORD",
"CHILD_JSON": [
{
"COL_ONE": "dfgsdfg"
},
{
"COL_ONE": "xcvbxcvb"
}
]
}
]
The Data Mapper gives you better functionality for multiple loops, arrays, etc. As I said, it is a tricky tool to get to grips with, but once you understand it is very useful. I would recommend taking a Talend Data Mapper course to get to grips with it.
If you have the subscription version you can use Talend Data Mapper. This is a better way of dealing with complex JSON structures, but can be quite a learning curve if you've never used it before. If you are using the Open Source product, then the way you are doing this is fine. Some people might be inclined to build more complex JSON using Java (since this is an option for people with Java skills), but from what I have seen you are approaching this in a reasonable way.
Thank you for the reply.
We do have real time big data version so we do have access to the data mapper. What would be the advantages of the data mapper in this case? I was looking at trying to use it but it didn't quite seem to work in this case where we're trying to map in multiple data flows that are a relational structure(or inversely shred json out into a relational structure).
The Data Mapper gives you better functionality for multiple loops, arrays, etc. As I said, it is a tricky tool to get to grips with, but once you understand it is very useful. I would recommend taking a Talend Data Mapper course to get to grips with it.
Thanks for the feedback both of you, we'll be looking at the datamapper in the future.
For now the solution we have seems to work for what we need.
Currently I have 2 csv files and I expect the first is the json file according to the image I sent. Currently I have not thought of a solution. Can you help me
What are you trying to do? Merge the two csv's into a json structure?
Yes, I merged 2 csv files into json files in an integrated structure. But I have found a solution. I have followed tJSONDoc
https://jan-lolling.de/talend/components/help/tJSONDoc.pdf
Thank you.