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 1

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

Talend tRunJob 2

Create a Talend Parent Job

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

Parent Job 3

The following screenshot shows the available options.

Die on Child Error 4

Please click on the Browse job (…) button to select the previously designed job. Here, we selected the Data_Sorting_Parent_Job.

Choose from Repository Content 5

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.

Edit Schema 6

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

Talend Run Job 7

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.

Change the Input Row Count 8

Let me add the tLogRow to show you the aggregated output.

Choose Table Preview Mode 9

Please run the tRunJob to see the result.

Talend Run Job 10