Multiple inputs join tMap into mysqloutput

One Star

Multiple inputs join tMap into mysqloutput

Hello everyone!
I'm new to Talend ETL, and i'm facing a few problems to make my job work.
Here's the problem:
 I have three inputs:

an excel file that i've already used to insert the Company Name in a previous job;
a mysqlInput (company_size table) containing all the possible company sizes;
another mysqlInput (company table) with the inserted Company Name.

This excel file, contains an estimated company size in a string (201-500 employees, for example), this size is escaped by a Java script to return the min and max size of the company.
Those sizes are used to return the organisation_size_id from company_size table.
So, what i want to do is to insert into an associative entity containing organisation_size_id and party_id (from company).
But i'm getting this error:
Exception in component tMysqlInput_1
com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '4.294967295E9' in column '3' is outside valid range for the datatype INTEGER.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1025)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:973)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:918)
at com.mysql.jdbc.ResultSetImpl.throwRangeException(ResultSetImpl.java:7875)
at com.mysql.jdbc.ResultSetImpl.parseIntAsDouble(ResultSetImpl.java:7037)
at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2735)
at organisation.c_organisationsize_0_1.c_OrganisationSize.tMysqlInput_1Process(c_OrganisationSize.java:2531)
at organisation.c_organisationsize_0_1.c_OrganisationSize.tFileInputExcel_1Process(c_OrganisationSize.java:1052)
at organisation.c_organisationsize_0_1.c_OrganisationSize.runJobInTOS(c_OrganisationSize.java:3640)
at organisation.c_organisationsize_0_1.c_OrganisationSize.main(c_OrganisationSize.java:3497)

Code responsible for getting min and max size:
	/**
* Try to escape the string to find min and max company size
* if minSize is true, returns min company size, else, max company size
* @param companySize
* @param minSize
* @return
*/
public static int getCompanySize( String companySize, boolean minSize ){
int min = 0;
int max = 0;

if( companySize.isEmpty() )
return 0;
companySize = companySize.replaceAll("to", "-");
if( companySize.indexOf('-') > 0 ){
String[] sizes = companySize.split("-");
min = Integer.parseInt(sizes);
max = Integer.parseInt(sizes);
} else {
return Integer.parseInt(companySize);
}

if( minSize )
return min;
return max;
}

 

Can anyone help me please? Thanks! 
One Star

Re: Multiple inputs join tMap into mysqloutput

my screenshots didn't show up:
One Star

Re: Multiple inputs join tMap into mysqloutput

I resolved the problem, i inserted an unsigned integer value in my lookup mysql table and Talend couldn't understand as Integer, so i just changed 4294967295 to 10001, and it works now.
Job done! Smiley Happy