Printing tMap variables

If you inspect code generated from a tMap variable, you will see that each of the expressions are converted into a line of the following format:output column = expression;.

This suggests that the expression is limited to one line of Java code.

Although this is how we would normally treat tMap expressions (in order to avoid confusion), this isn't strictly true, and there is one scenario where breaking this rule may be useful.

The scenario in question relates to tMap variables. If a tMap variable fails due to an exception in a variable expression that is itself a result of a variable expression, then the job can become quite difficult to debug.

To make it easier to see what is happening in each step, we can add a System.out.println ...

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.