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

View solution in original post


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

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

View solution in original post

Four Stars

Re: Load numeric / boolean data

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

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog