Skip to main content Skip to complementary content
Close announcements banner

Generating random data

With the help of the tRowGenerator component, Talend Studio can create random data to help you test its features.

About this task

Follow the examples to create a fictional database of clients.

Procedure

  1. Add a tRowGenerator component.
    This component helps you generate random data for testing purposes.
  2. Double-click the tRowGenerator component.
    You are brought in the tRowGenerator configuration window.
  3. Click the plus button to add a Column.
    1. In the Column field, enter a name.

      Example

      1. CustomerID
      2. FirstName
      3. LastName
    2. Select the column Types.

      Example

      1. For CustomerID, select the Integer Type.
      2. For FirstName and LastName, select the String Type.
    3. Select the column Functions.

      Example

      1. For CustomerID, select the Numeric.random(int,int) function.

        This function generates random numbers.

      2. For FirstName, select the TalendDataGenerator.getFirstName() function.

        This function generates random first names.

      3. For LastName, select the TalendDataGenerator.getLastName() function.

        This function generates random last names.

  4. Optional: Configure your Columns.

    Example

    For CustomerID, in the Function parameters tab, enter a max value of 1000.
  5. Optional: Enter the number of your choice in the Number of Rows for RowGenerator field.

    Example

    Enter 1000 to create a 1000 customers.
  6. Click OK.

Results

You have configured a tRowGenerator component to generate random data. You can now use it to test other features of Talend Studio.

What to do next

Click the Preview button in the Preview tab to try this feature.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!