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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access