Using tRest and tExtractJSONField to map the JSON file in Talend

0 votes

I am struggling with tRest component while trying to retrieve the JSON data. I am sharing the screenshot of the Job I have created. image

Following is the screenshot of my tExtractJSONField component which I am using in order to extract the “text” field from the input data: image

But the with this is, I am not able to add all the attributes for mapping.

Please suggest me how to get this done.

Following is the sample of the input file I am using:

{
"posts": 
 [
    {
        "network": "twitter",
        "post_id": "547835328170823680",
        "text": "#tunisie .. #tunis",
        "html": " ",
        "permalink": " ",
        "post_time": 1419449095,
        "user_id": "159415522",
        "user_name": " ",
        "user_real_name": " ",
        "user_profile_image_url": " ",
        "hashtags": [ "tunisie", "tunis" ]        
    },
    {
        "network": "Facebook",
        "post_id": "547835328170823680",
        "text": "#tunisia .. #tunis",
        "html": " ",
        "permalink": " ",
        "post_time": 1777449095,
        "user_id": "159995522",
        "user_name": " ",
        "user_real_name": " ",
        "user_profile_image_url": " ",
        "hashtags": [ "tunisia", "tunis2" ]        
    }
]
}
Apr 18, 2018 in Talend by code.reaper12
• 3,470 points
2,496 views

1 answer to this question.

0 votes

In this case, I believe you can use tMap component. It's a powerful processing component which comes in handy in multiple scenarios. In order to configure the schema of the incoming and outgoing data follow the below example:

image

answered Apr 18, 2018 by geek.erkami
• 2,680 points

Related Questions In Talend

0 votes
1 answer
0 votes
1 answer

Using tHiveRow to execute multiple Hive queries in Talend

In order to execute multiple queries, you ...READ MORE

answered Apr 14, 2018 in Talend by misc.edu04
• 1,430 points
1,616 views
0 votes
1 answer
0 votes
1 answer

How to loading flat file from configuration in Talend?

Hey, @There, Regarding your query you need to ...READ MORE

answered Jun 3 in Talend by Gitika
• 52,000 points
148 views
0 votes
1 answer

tWaitForFile component insufficiency in Talend

Regarding your first issue, tWaitForFile component provides ...READ MORE

answered Apr 10, 2018 in Talend by geek.erkami
• 2,680 points
809 views
0 votes
1 answer
0 votes
2 answers

Closed loop in Talend

Hi, Talend specifies that tUnite cannot be ...READ MORE

answered Aug 22, 2019 in Talend by vinceall
783 views
0 votes
1 answer
0 votes
1 answer

Using Java Classes in Talend

While working with routines, the very 1st ...READ MORE

answered Apr 14, 2018 in Talend by geek.erkami
• 2,680 points
1,088 views