Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone, I'm new with Talend Open Studio and still learning. I have some records from input file and I want to group of these records and send to child job.
Here is example of records from input file:
PARENT | CHILD |
John | Sally |
John | Sarah |
Taylor | Adam |
Taylor | Aaron |
Taylor | Aria |
Goh | JiaWei |
What I expect is the data will be send by group of parent, but it send by rows. So here is what I expect :
.----------+----------. | tLogRow_1 | |=---------+---------=| |Parent |Child | |=---------+---------=| |John |Sally | |John |Sarah | '----------+----------' .----------+----------. | tLogRow_1 | |=---------+---------=| |Parent |Child | |=---------+---------=| |Taylor |Adam | |Taylor |Aaron | |Taylor |Aria | '----------+----------' .----------+----------. | tLogRow_1 | |=---------+---------=| |Parent |Child | |=---------+---------=| |Goh |Jiawei | '----------+----------'
Here what I got:
.----------+----------. | tLogRow_1 | |=---------+---------=| |Parent |Child | |=---------+---------=| |John |Sally | '----------+----------' .----------+----------. | tLogRow_1 | |=---------+---------=| |Parent |Child | |=---------+---------=| |John |Sarah | '----------+----------' .----------+----------. | tLogRow_1 | |=---------+---------=| |Parent |Child | |=---------+---------=| |Taylor |Adam | '----------+----------'
This is how I set to send the records to child job. Figure below is tRunJob setting in parent job
Here is what I set in context in child job :
Can someone help me on how to send a group of records to child job?
You need to aggregate records using tAggregateRow component before to call the child job.
Based on your initial design, it should come after tHashInput.
Set "Group by" on PARENT field, then in "Operations" add a line with CHILD for "Output column" and "List" for "Function".
This will give you PARENT = John and CHILD = Sally,Sarah for the 1rst group and so on.
Finally, in the child job you have to convert CHILD field from list to records to retrieve original dataset.
This could be done using tNormalize component.
You need to aggregate records using tAggregateRow component before to call the child job.
Based on your initial design, it should come after tHashInput.
Set "Group by" on PARENT field, then in "Operations" add a line with CHILD for "Output column" and "List" for "Function".
This will give you PARENT = John and CHILD = Sally,Sarah for the 1rst group and so on.
Finally, in the child job you have to convert CHILD field from list to records to retrieve original dataset.
This could be done using tNormalize component.
yeay, thank you