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.

Talend tRowGenerator 1

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.

Components Tab 2

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

Edit Schema 3

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. And to add a new column, please use the + button. In order to generate random rows, we have to assign a function.

Functions 4

For the SNo, we used the Numeric sequence function.

Talend tRowGenerator 5

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

Function parameters 6

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

Talend tRowGenerator 7

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.

Click Ok to close the window 8

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 Job 9

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.
Talend tRowGenerator 10

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

Talend tRowGenerator 11