global map

One Star

global map

It seems that when I call global map in tMap with ((Integer)globalMap.get("sipr")) it returns null pointer exception.
I insert variable into global Map from tJavaRow with globalMap.put("sipr",sipr); type is integer
any suggestions???
Highlighted
One Star

Re: global map

Hi,
That most likely means that the put has not been executed before the get, or the put has put a null sipr. You can verify this with the debugger.
Daniel
One Star

Re: global map

It probalby puts NULL. What do I do?
I am not a java programer so any hint to write a code would be nice.
Thank you
One Star

Re: global map

Hi Guys,
Yup, it returns null and you must handle the null value properly. You could put a condition like this :
((Integer)globalMap.get("sipr")) == null ? 0: ((Integer)globalMap.get("sipr"))
One Star

Re: global map

Thanks. It worked.
One Star

Re: global map

You're welcome :-)

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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download