Talend tRunJob

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.

tSortRow example

To show the data, let me connect the tLogRow to the tBufferOutput and run the Talend tRunJob.

check the output or result

Create a Talend Parent Job

We created another job and then added the Talend tRunJob component to the designer window.

Add Talend tRunJob to workflow for the parent job

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.

Choose the Parent Job from the Repository Content

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.

Click. the Edit Schema to check the columns

Please change the version as per your needs. Next, add the Context Parameters (if any).

Configure the Talend tRunJob to run parent job

Here, we added the tAggregateSortedRow and connected it to Talend tRunJob. Generally, tAggregateSortedRow needs 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.

Configure aggregate sorted rows

Let me add the tLogRow to show you the aggregated output. To do this, add the tLogRow to the workflow and connect the tAggregateSortedRow main row to it. Next, within the tLogRow component tab, choose the table option.

Please run the tRunJob to see the result.

Run Talend tRunJob to execute the parent job