Checking a column against a list of allowed values

Often it is necessary to ensure that a column contains only values as defined in a list. This recipe shows how this can be achieved using a tMap expression.

Getting ready

Open the job jo_cook_ch03_0040_tMapValuesInList. You will notice that the job is very similar to the previous recipe Rejecting rows using tMap.

How to do it…

  1. Open tMap and click the expression builder button (…), and add the test criteria, as shown in the following screenshot:
    How to do it…
  2. Run the job and you should see that one of the rows is rejected.

How it works…

The tMap conditions are the same as Java conditions, so the symbol || (pipe pipe) ...

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.