O'Reilly logo

Talend Open Studio Cookbook by Rick Barton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required