Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Raghuram_Puram
Contributor III
Contributor III

NullPointer Exception in tMap

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

Labels (1)
  • v7.x

1 Solution

Accepted Solutions
Raghuram_Puram
Contributor III
Contributor III
Author

@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.

View solution in original post

9 Replies
manodwhb
Champion II
Champion II

@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

 

 

Anonymous
Not applicable

hello @rchinta 

Can you please share more screenshots of Tmap and their datatypes,expression filter

 

Thanks,

Manish

Raghuram_Puram
Contributor III
Contributor III
Author

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.

 

 

0683p000009M8PC.png

 

manodwhb
Champion II
Champion II

@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.

Anonymous
Not applicable

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

Raghuram_Puram
Contributor III
Contributor III
Author

@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.

Vijay_K_N
Contributor
Contributor

How to find null column if we have so many columns in given file

Anonymous
Not applicable

@lli, you can use tSchemaCompianceCheck to check the Null value base on the schema.
Vijay_K_N
Contributor
Contributor

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