Parse XML : error when get "NaN" value for insert in mysql Float field

One Star

Parse XML : error when get "NaN" value for insert in mysql Float field

Hi Everybody,
I'm really novice in Talend Open Studio. It's my first use, but I found lot of documentation about this great product !
I have lot of data as XML files (300Mo) for analyse, and I decided to insert it into a mySQL Database.
The row structure : 1 String, 1 Date, and many Number fields by row.
My architecture : tFileList > tFileInputXML > tMAP > mySQLTableOutput
Everything works good, but I have only one problem :
In the XML file, some "row" have "NaN" value for only some fields, so when Talend insert this row in mysql, mysql reject it, because of the "NaN" value is not a Float I guess.
So, my question is : How can I setup Talend to recognize "NaN" value as a "null" value, to convert it to a "null" or "0" value ?
Thanks for your help !
Dimix.
One Star

Re: Parse XML : error when get "NaN" value for insert in mysql Float field

I thought about a "if" in the Map Field Expression ... ?
Highlighted
One Star

Re: Parse XML : error when get "NaN" value for insert in mysql Float field

I did that : (row1.FIELD.isNaN())?0:row1.FIELD
I don't know if it's the more efficient, but that's works !
One Star

Re: Parse XML : error when get "NaN" value for insert in mysql Float field

Is it legitimate for your XML to contain non-numerical data?

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch