Four Stars

Load numeric / boolean data

Hello,

 

I'm using  "Open Studio for Data Integration" and I have a simple job which reads from mysql and writes to Google BigQuery.

 

I'm getting the following error while trying to read from a table that includes any numeric/boolean values:

"the operator =! is undefined for the argument type(s) int, null" 

 

If the source table contains only strings, the job works fine.

 

Both input and output schemes are defined with the corrected variable types.

 

The JAVA code compare int to null which makes this exception, but I do not have the option to change it.

 

Am I doing something wrong,  or its a bug?

 

Print screen is attached,

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: Load numeric / boolean data

Hi  

The operator != is not defined for int type, If I check 'Nullable' box on the schema, the type will be changed to Integer and the compilation error is fixed.

1.png

 

Regards

Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
7 REPLIES
Community Manager

Re: Load numeric / boolean data

Check the 'nullable' box of id column on the schema. Let me know if it works.

----------------------------------------------------------
Talend | Data Agility for Modern Business
Forteen Stars TRF
Forteen Stars

Re: Load numeric / boolean data

In Java, Int can't be null. However, Integer can be null.

Check this link https://stackoverflow.com/questions/2254435/can-an-int-be-null-in-java


TRF
Four Stars

Re: Load numeric / boolean data

Hi Shong,

It's still not working

 

Thanks

Four Stars

Re: Load numeric / boolean data

Thanks TRF,

I don't think that I have the option to change the JAVA code through the UI interface

 
 
Forteen Stars TRF
Forteen Stars

Re: Load numeric / boolean data

No, you don't.
But you probably may convert int value to Integer then compare to null

TRF
Community Manager

Re: Load numeric / boolean data

Hi  

The operator != is not defined for int type, If I check 'Nullable' box on the schema, the type will be changed to Integer and the compilation error is fixed.

1.png

 

Regards

Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
Four Stars

Re: Load numeric / boolean data

I tried now and it worked, thank you for the clarification