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:
- Open
tMap
. - Open the
tMap
settings for theproductData
input flow. - Change the Match Model to First Match.
- For the Expr. key for productData, add the code:
Numeric.random(1,15)
- Drag all columns from both inputs to the output.
- Your
tMap
should now look like this: - 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.