Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
SMahadevan1608028474
Contributor
Contributor

Empty String (Soruce data have the null value) error message when converting String to Decimal format

Source

-------

Product price

This is column is not mandatory and it have null values also in source data and it's reading the data as String.

Var

----

I have created with var Int datatype.

(int)(Double.parseDouble(row4.Product_price)*10000)

Output table - Set datatype as Double

-------------

Double.parseDouble(String.valueOf(Var.var2))/10000

So in Schemacompilance I have selected Nullable checkbox for this column.

 

After run the job since the source file as Null value am getting the below error,

java.lang.NumberFormatException: empty String

Labels (2)
10 Replies
SMahadevan1608028474
Contributor
Contributor
Author

Even I have tried with logics but the same error am getting,

 

Am trim the value even it is null and check the length of the column. Some time if you have any blank spaces it will workout the null condition check.

 

Please correct me if anything wrong here.

 

((StringHandling.TRIM(row4.Unit_Selling_Price).length()<=0)?null:(int)(Double.parseDouble(row4.Unit_Selling_Price)*10000))