Sunday 21 February 2016

find and fix Null Pointer exception in tmap

very often you will face null pointer exception in tamp in ta lend job

There could be mainly  two reasons for this error

1 . you are taking input from null able columns and inserting in not null columns.
2. you are applying any java method on the data of the columns which can potentially has nulls values.

 Soln 1 :-as far as 1st is concerned you can very easily find which input column is nullable and if mapped to not null columns then you can directly handle nulls in input  by isnull to get the default value if null came or like this http://talend-training.blogspot.in/2011/12/how-to-handle-null-pointer-exception-in.html.

Soln 2 :- check if you are applying any java method on columns which can be null  these nulls may arise due to left outer or right joins.

first find error data which is failing due to this error by by unchecking die on error option in tmap and map error records in log row and then you can very easily trace what value is causing this null pointer excepction.

let me know if have any confusion