Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have a talend job that throws NullPointer Exception no matter what I try.
Job design goes something like this:
tHiveInput --> tMap --> tHDFS
I did the null check wherever I have used functions for transformations.
tHiveInput-->tLogRow - All records from source are flowing to tLogRow and printed on console.
tHiveInput --> tMap - job throws NullPointer after 1st record itself.
Please help.
Thank you!
Regards,
Raghuram
@haralba Thanks for the suggestion, it worked. I tried to check the mappings one by one and found that there was a context variable mapped to one of the fields which value was not assigned/loaded.
Evidently, that column was an Integer type and couldn't take Null values in it.
Removed that mapping and job was working fine.
@rchinta , what are you doing in tMap. I believe you might have written some expression .
something like below.
for example:-
row1.col1.equals("IND")? "INDIA" :row1.col1
re-write below way ,so that you will not get null pointer exception.
("IND").equals(row1.col1)? "INDIA" :row1.col1
hello @rchinta
Can you please share more screenshots of Tmap and their datatypes,expression filter
Thanks,
Manish
Hi @vitspltalend ,
Please find the tMap below. Input data volume is low, am testing on a dataset of 150 records only.
I have done a debug run also and couldnt come to any conclusion.
@rchinta , it would be on different files ,where you were not handling null values and trying to check for some other expressions like journal_desc.
What I usually do is: I copy the job and I delete some fields so I try to find wich field is the problematic one
@haralba Thanks for the suggestion, it worked. I tried to check the mappings one by one and found that there was a context variable mapped to one of the fields which value was not assigned/loaded.
Evidently, that column was an Integer type and couldn't take Null values in it.
Removed that mapping and job was working fine.
How to find null column if we have so many columns in given file
if we have so many columns how can i manually check....if we put custom defined option in schemacomplaince check there is one option is available i.e nullable ,,why we need to tick all the columns to check if that column have nulls or not