One Star

conversion of types with tConvert

Hi,
I tried to convert some fields of an output table (from string to int) to put them in another table, i used the option "edit schema" of the component "tConvertType" but it generates an error kind of "at java.lang.Integer.parseInt(Unknown Source)".
could u tell me where is the problem.
thanks
4 REPLIES
Community Manager

Re: conversion of types with tConvert

Hello
error kind of "at java.lang.Integer.parseInt(Unknown Source)".

There are some empty value in your input data. You must deal with the empty value before you convert string to int.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: conversion of types with tConvert

How can I filter null, NA, and zero rows with talend filter logic? Pls advise. I have data which has null for the value column, sometimes "NA" and sometimes 0. I would like to understand a logic how to filter them. Furthermore how can I convert a string to double, simply switching the type on the schema of the convert fuction? Pls advise.
Thx
gsfd2000
One Star

Re: conversion of types with tConvert

HI, me again
I am using tconvert to convert string decimal values to double. I hope that I filtered "NA" and null values before. Nevertheless I get this error:
Exception in component tConvertType_1
java.lang.NumberFormatException: For input string: "249,448.8400000"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Double.valueOf(Unknown Source)
at routines.system.TypeConvert.String2Double(TypeConvert.java:4136)
at fbs_hu_atl.na_to_zero_conversion_0_1.NA_to_zero_conversion.tFileInputDelimited_1Process(NA_to_zero_conversion.java:1646)
at fbs_hu_atl.na_to_zero_conversion_0_1.NA_to_zero_conversion.runJobInTOS(NA_to_zero_conversion.java:1963)
at fbs_hu_atl.na_to_zero_conversion_0_1.NA_to_zero_conversion.main(NA_to_zero_conversion.java:1869)
what does that mean?
thx
gsfd2000
Community Manager

Re: conversion of types with tConvert

Hello
what does that mean?

Before you convert the data type, you need to filter the null rows and delete the comma ",". See my screenshots.

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business