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: 
jerownimow
Contributor III
Contributor III

How to process the next iteration when the first extract on tfilterrow returns null pointer exception?

Hi Experts, Good day!

I have a job:

0683p000009M2FW.png

Inside the tMap:
0683p000009M2N0.png

The globalMap key will be used as a condition on tFilterRow to get the corresponding nxtMngrdn. However, when the record does not exist on the lookup it throws a NullPointerException error due to the fact that there's no row returned from tFilterRow.
What I want to have is to ignore the Null Pointer and continue with the process and for that specific record the output will be the values from the left table and only blank/null values from the lookup table if the record does not exist.

For ex:
displayName;dn;manager
David Shays;cn=dshays;cn=vladimirs
When cn=vladimirs does not exist on the filtered lookup, it will only return blank/null and it will not throw a Null Pointer error.

tFilterRow is essential and should not be removed as it is used to get the next manager level.

Please let me know your thoughts on this.

Thank you.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Can you show me line 7482. That is the line the error is happening on. It looks like the error is in the tMap_1. Also, take a look here: https://community.talend.com/t5/How-Tos-and-Best-Practices/How-to-debug-tMap-errors/td-p/40951

 

This mini tutorial shows you how to effectively debug tMap errors.

View solution in original post

10 Replies
Anonymous
Not applicable

Can you show us your "out" schema please? I suspect you can easily solve this by ensuring that the last 3 columns are set to "nullable" via the tick box in the schema. Since there are some expressions in these columns on the "out" column, I suspect you may need to ensure that those expressions are built to ensure that NULL doesn't cause a nullpointerexception. To do that, just carry out null checks before attempting to use the objects (columns).

jerownimow
Contributor III
Contributor III
Author

Thank you for your reply @rhall .
Those expressions are for Handling Null values. I already tried ticking the nullable but still got the same error.
0683p000009M2AC.png

I believe it's occuring on the tFilterRow since it will not return any record just like my example. 

Anonymous
Not applicable

OK, well my first suggestion was my Occam's razor suggestion 🙂

 

Can you post your error stack please? This should give more clues. You *may* be able to find out more information yourself using this. The error stack will provide some lines of Java code which are failing. If you click on the "Code" tab in the bottom left corner of your design window screen, you will see the Java code that is generated. This screen should show line numbers, if not there is a think grey strip on the left of the window showing code. Right click on that and you will see an option to show the line numbers. Take a look there and see if you can spot where the error is actually being triggered. This will help you solve this.

jerownimow
Contributor III
Contributor III
Author

No problem 0683p000009MACn.png
Here's the error stack:
0683p000009M2NF.png
I don't see an error on the code. My hunch is that it's a data issue, just need to handle it.

Anonymous
Not applicable

Can you show me line 7482. That is the line the error is happening on. It looks like the error is in the tMap_1. Also, take a look here: https://community.talend.com/t5/How-Tos-and-Best-Practices/How-to-debug-tMap-errors/td-p/40951

 

This mini tutorial shows you how to effectively debug tMap errors.

jerownimow
Contributor III
Contributor III
Author

0683p000009M2Ne.png

Here's line 7482. Thank you for sharing this link, I'll check this and refer to this link in the future.

Anonymous
Not applicable

Can you post all of the expressions that involve columns from the lookup table? I *think* your CEO one might be the cause. You seem to check that the main column is not null and then I *think* you might be using a value from your lookup without checking for its null status.

jerownimow
Contributor III
Contributor III
Author

Thank you @rhall . I've managed to fix the problem. Now my issue is on tLoop_1, it throws NullPointer on its first Iteration which is weird. I only expect this to be on infinite loop, but not this error.0683p000009M2Kg.png
Can you help me again troubleshoot this piece?

tJava_2 code: 
String foo = "bar";
globalMap.put("inLoop", 0);

tLoop_1 settings:
Declaration: int i=0
Condition: (Integer)globalMap.get("inLoop"")!=1
Iteration: i++

Thank you in advance!

jerownimow
Contributor III
Contributor III
Author

This is okay now. I just move the onsubjob ok to tJava.

Thank you for all your inputs, @rhall .