Four Stars

How to handle null in Talend ?

Good morning,

I'm having the following issue:


I'm getting a csv file containing data I want to write to the stage DB.

one of the fields is an integer and sometimes  I get "null".

It Looks like Talend is not interpreting this as null , rather as a string.

How can I avoid the following message :?


Couldn't parse value for column 'processor_count_pending_general_purpose' in 'in_zCPC, value is 'null'. Details: java.lang.NumberFormatException: For input string: "null".


The dataset looks like :



Kind Regards



Nine Stars

Re: How to handle null in Talend ?

While you have retrieved your data from csv and you have prepared your schema you might had selected "string" for that specific column if you are worried if the data type is treated as "string".

If you are transforming your retrieved data through tMap then you could add the condition to check for NULL values and then process the values as per your criteria - 

(Relational.ISNULL(row1.processor_count_pending_general_purpose) || row1.processor_count_pending_general_purpose.isEmpty() || row1.processor_count_pending_general_purpose.toString() == null) ? (true do something) : (false do something else)