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,450 points
911 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,320 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,380 points
638 views
0 votes
1 answer
0 votes
1 answer

Looping through all the schemas in Talend

It is really simple to make tOracleInput ...READ MORE

answered Apr 10, 2018 in Talend by code.reaper12
• 3,450 points
74 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,320 points
260 views
0 votes
1 answer
0 votes
1 answer

Closed loop in Talend

As you might know,  in Talend all ...READ MORE

answered Apr 19, 2018 in Talend by code.reaper12
• 3,450 points
281 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,320 points
340 views