Load numeric / boolean data

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!


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

All 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
Fifteen Stars TRF
Fifteen 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

 
 
Fifteen Stars TRF
Fifteen 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

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

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now