In this article, we use this Talend tRunJob component to demonstrate parent-child jobs. This example helps you understand the tBufferOutput, and how to read the data from parent job to child job.
To demonstrate the Talend tRunJob, we use the tSortRow example that we created earlier. Here, we used the tDBInput to choose the customer table and tSortRow to sort the records in the below-shown order. Instead of saving the output in a table, we are using the tBufferOutput to buffer the data.
To show the data, let me connect the tLogRow to the tBufferOutput and run the Talend tRunJob.
Create a Talend Parent Job
We created another job and then added the Talend tRunJob component to the designer window.
The following screenshot shows the available options.
Please click on the Browse job (…) button to select the previously designed job. Here, we selected the Data_Sorting_Parent_Job.
First, click on the Copy Child Job Schema to add or load columns in the selected job to the current job. Next, click on the Edit Schema to check and add/remove unwanted columns.
Please change the version as per your needs. Next, add the Context Parameters (if any).
Here, we added the tAggregateSortedRow and connected it to Talend tRunJob. Generally, tAggregateSortedRow need sorted data, and our child job sorted those rows using the tSortRow component. Within the tAggregateSortedRow, we grouped the columns by Occupation and performed a few aggregations.
Let me add the tLogRow to show you the aggregated output.
Please run the tRunJob to see the result.