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 :-)

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

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