Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gouravd_7
Creator
Creator

Null pointer error in tmap

Hi Team,

 

Getting error in tmap , i have applied all columns as nullable but have lookups with another tmap. 

 

Please find the attached screenshot of the tmap and the sub job.

 

Thanks,

Gourav

Labels (2)
1 Solution

Accepted Solutions
gouravd_7
Creator
Creator
Author

Hi Team,

 

After applying so many changes in tmap still was not able to fix the issue and since I was doing an inner join , I switched the main and lookup which surprisingly solved the issue. 

 

As it was an inner join nothing much affected and the job runs finally 0683p000009MACn.png

 

Thanks everyone who helped me to fixing the issue but tmap works really weird at times sounds funny that after switching the main and lookup issue resolved.

 

Thanks,

Gourav

 

 

View solution in original post

11 Replies
Anonymous
Not applicable

Hi Gourav,

 

     The issue is happening at tMap42 which means that Null pointer exception is coming from function. There are two functions here.

 

a) the left function at Var section

b) the output filter based on equal condition.

 

To avoid this issue, please add a Null check at the beginning. If the value is null, do not pass the data to the functions. For example,

 

!Relational.ISNULL(Var.var1) && ("SEG").equals.Var.var1

The Null check should be the first function for all verifications in your tMap operation if there is any chance of having null value in input data.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

gouravd_7
Creator
Creator
Author

Hi Nikhil,

 

I have handled this in variable still getting the same error. I also tried your expression but no luck still the issue remains same.

 

row78.newColumn5==null?null0683p000009M9p6.pngtringHandling.LEFT(row78.newColumn5, 3)

 

Thanks,

Gourav

Anonymous
Not applicable

Hi Gourav,

 

     The rule number 1 is that you cannot equate null value to another null. You will have to do it by following way.

 

Relational.ISNULL(row78.newColumn5)?null:StringHandling.LEFT(row78.newColumn5, 3)

I hope this will resolve your issue. Please spare a second to mark the topic as resolved 🙂 Kudos will be a bonus!

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

gouravd_7
Creator
Creator
Author

Hi Nikhil,

 

Tried the above expression too but the error remains same.

Error:

Exception in component tMap_43 (MAGNITUDE_SCRIPT_INDUSINT)
java.lang.Exception: java.lang.NullPointerException
at group_directory.magnitude_script_indusint_0_1.MAGNITUDE_SCRIPT_INDUSINT.tLDAPInput_16Process(MAGNITUDE_SCRIPT_INDUSINT.java:5275)
at group_directory.magnitude_script_indusint_0_1.MAGNITUDE_SCRIPT_INDUSINT.runJobInTOS(MAGNITUDE_SCRIPT_INDUSINT.java:6433)
at group_directory.magnitude_script_indusint_0_1.MAGNITUDE_SCRIPT_INDUSINT.main(MAGNITUDE_SCRIPT_INDUSINT.java:6059)
Caused by: java.lang.NullPointerException
at group_directory.magnitude_script_indusint_0_1.MAGNITUDE_SCRIPT_INDUSINT.tLDAPInput_16Process(MAGNITUDE_SCRIPT_INDUSINT.java:5041)

Anonymous
Not applicable

Hi Gourav,

 

     Please remove the tMap and put a tLogrow to verify various null value components. Add the Null check function wherever needed. Its clearly says the error is Null value issue and the issue is at tMap component.

 

     So put a tLogrow before and after this component for verification. Also add few columns at a time to track the problematic column. There are no easy solutions other than data verification in this case.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable

Hi

 

From the screenshots the error may come in two cases from your job.

1. the variable var1

2. You are concatenating required columns and passing it to the output column DN. Did you verify is there any of the column is getting is null?

 

For point no 1: @nthampi provided the exact check condition to you.

For point no 2: Please check the columns that you are concatenating and apply null handling to those columns as well.

 

Anonymous
Not applicable

@gouravd_7 

 

Are you still facing the issue or whether the details helped you to locate the problem area?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

gouravd_7
Creator
Creator
Author

Hi Nikhil,

 

I am still facing the issue as the job has 8 subjobs with multiple lookups in one Sub job seems there is lot of tmap issues which don't exactly pointing to the tmap instead its point to the Input just before the lookup.

 

As all errors are of null pointer and the person who designed the job has not handled it properly everywhere so , I am handling it now.

 

I will post the solution once done with the same. 

 

Thanks for the follow up.

 

Thanks,

Gourav

bhagyarekha
Creator II
Creator II

hi
just give try like this
row78.newColumn5!=null?stringHandling.LEFT(row78.newColumn5, 3):null