Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
VRadhakrishnan1651487711
Contributor III
Contributor III

Null Pointer exception for date field from source

Hello Friends

I need your help on clearing an issue, when i tried to implement SCD2 Concept

Below is my source

Cust_id Cust_ty_id Cust_nm Birth_dt

1 101 John null

When i tried to use tMap to compare the source and Lookup using the variable formula

row3.BIRTH_DT==null ||row2.BIRTH_DT==null?"1":row3.BIRTH_DT.equals(row2.BIRTH_DT)?"0":"1" 

Im getting the Null pointer exception. Arrached the screenshot of the tMap and Job

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

@Vinothkumar Radhakrishnan​ ,the error might come from other expression such as TalendDate.parseDate(String pattern, String date_string) in the output table of tMap, go to check expression one by one and confirm which expression throws the error.

 

Regards

Shong

View solution in original post

6 Replies
Anonymous
Not applicable

It's difficult to see all of your logic in the screenshots, but what is happening is that you are trying to call a method on an object that is null. The first thing that should be done before calling methods on objects is to ensure that the object is not null. I suspect that this is not the logic that is directly causing this, but the column methods that are called on the output of this logic. I see it is either 1 or 0. See if you can check the output data. I'd look at the dates that are being processed with methods as your first port of call.

VRadhakrishnan1651487711
Contributor III
Contributor III
Author

Hi rhall

I have used

 

(row3.BIRTH_DT==null )? null : 

row3.BIRTH_DT.equals(row2.BIRTH_DT)?"0":"1" 

 

if birth_dt is null then insert/update as null else compare and set 1 or 0

VRadhakrishnan1651487711
Contributor III
Contributor III
Author

0695b00000QFy7aAAD.png

Anonymous
Not applicable

Can you show us the exact error message you get please? By that I mean, the error reported in the output Window. Something is null when it is being called or being used if you are getting a NullPointerException.

VRadhakrishnan1651487711
Contributor III
Contributor III
Author

0695b00000RgApLAAV.png

Anonymous
Not applicable

@Vinothkumar Radhakrishnan​ ,the error might come from other expression such as TalendDate.parseDate(String pattern, String date_string) in the output table of tMap, go to check expression one by one and confirm which expression throws the error.

 

Regards

Shong