Talend tRowGenerator

The Talend tRowGenerator component generates random rows so that we can use them for testing purposes. The Talend tRowGenerator supports all the built-in functions and has a few functions to generate the first name, last name, state, etc. We can use this Talend Row Generator to generate as many rows as we want.

Talend tRowGenerator Example

Drag and drop the tRowGenerator into the job design.

Add Talend tRowGenerator to Workflow to generate rows

There are two ways to add column names for the randomly generated rows. The first option is to click the Edit Schema button and add the column names, data type, length, and precision.

For the Talend tRowGenerator demo purpose, let me add the SNo and first name as the column names.

Click the Edit Schema to add Columns

The second option is to click on the RowGenerator Editor button.

Clicking the Talend tRowGenerator Editor button opens the following window. Here, you can see the columns that we created earlier. To add a new column, please use the + button. In order to generate random rows, we have to assign a function. For the SNo, we used the Numeric sequence function.

Talend tRowGenerator Function to to generate rows

Use the below-marked pane (Function Parameters tab) to alter the values such as the start value and steps.

Please change the Number of Rows for the Talend tRowGenerator to the required number. The default value is 100, so by default, it generates 100 rows. However, you can change it to 1000, 10, etc.

Check the Function parameters for start and step value

The Talend Data Generator class has the getFirstName function that generates random first names. So, let me select the same.

Add the remaining columns

Here, we used the tLogRow to display the rows and run the tRowGenerator job. From the below Talend image, you can see generated random rows.

Run the Talend tRowGenerator Job to generate rows

Let me add a few more columns.

  • LastName: We used getLastName() method to generate random last names. Next, we used the StringHandling UPCASE to convert the randomly generated last names to upper case.
  • Street: getUsStreet() method to generate US streets.
  • Date: getCurrentDate() to get the current date.
  • Sales: The Numeric random function generates random integer numbers from the minimum value to the maximum value.
Add More Columns in Talend tRowGenerator to generate rows

Please see the randomly generated rows by the Talend tRowGenerator job.

Run the Talend tRowGenerator to generate random rows