Creating random test data using lookups

This simple technique shows how we can randomly assign values using lookups.

Getting ready

Open the jo_cook_ch10_0120_randomTestDataLookups job.

How to do it...

The steps for creating random test data using lookups are as follows:

  1. Open tMap.
  2. Open the tMap settings for the productData input flow.
  3. Change the Match Model to First Match.
  4. For the Expr. key for productData, add the code:
    Numeric.random(1,15)
  5. Drag all columns from both inputs to the output.
  6. Your tMap should now look like this:
    How to do it...
  7. Exit tMap and run the job.

How it works...

As you will see from the output, the job will add a random product ID and product description ...

Get Talend Open Studio Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.