Error on run shows - For input string: "599.75" (in red), but job complete without error on component

Highlighted
Four Stars

Error on run shows - For input string: "599.75" (in red), but job complete without error on component

I am making a job to read 60000 lines of excel and insert to mysql, job completes with some red error showing one of the field value in excel and 4 hundreds lines are missing in the DB. I set "Die on error" on both Excel read and MySqlInput component but it never die.

 

I am new to this tool and it would be grateful if I could get help on debugging such situation.

 

Thanks a lot.


Accepted Solutions
Four Stars

Re: Error on run shows - For input string: "599.75" (in red), but job complete without error on component

Finally I found in document that expression should be like this:

row1.Unit_Value==null?0:row1.Unit_Value.intValue()

My problem is solved!
Thank you!

View solution in original post


All Replies
Six Stars

Re: Error on run shows - For input string: "599.75" (in red), but job complete without error on component

Can you provide your schema where you try to load these data.

This is probably a bad schema matching (lengh too long probably)

 

Do this :

 

1) Try to increase the lengh of the column in your output table schema.

OR

2) Truncate your value to fit the schema.

 

Four Stars

Re: Error on run shows - For input string: "599.75" (in red), but job complete without error on component

Hi AmanKino,

 

Thank you for your suggestion. Finally I find out there is a "Unit_Value" column that I want to convert it to integer, used row1.Unit_Value.intValue() then java throw out error when coming to a blank cell.

 

Would you teach me how to put a "if" condition so as to put integer 0 to blank cells or it contains a string?

 

I guess on the tMap corresponding output value:

if(!row1.Unit_Value.equals(null)){
     row1.Unit_Value.intValue();
}else{
     return 0;
}

 

But it comes to error...

 

Thanks a lot for your help.

 

Irvin

Four Stars

Re: Error on run shows - For input string: "599.75" (in red), but job complete without error on component

Finally I found in document that expression should be like this:

row1.Unit_Value==null?0:row1.Unit_Value.intValue()

My problem is solved!
Thank you!

View solution in original post

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog