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
code to an expression to print the state prior to execution of the failing step.
In this case, we simply force the expression logic in the generated code to become: output
column
=
expression;
System.out.println(output
column);
This is how...