Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
LDPtechAFB
Contributor III
Contributor III

GlobalMap variable Error, java.lang.NullPointerException

I need to count how many input i have before starting the component tDenormalizeSortedRow (If i put a number that are not the correct number of line, the last values are lost).

The problem is that i used a global variable : ((Integer)globalMap.get("tConvertType_1_NB_LINE"))

but it return a :

Exception in component tJava_1 (TestIDuniqueextract)

java.lang.NullPointerException

I don"t know why the global variable is null, 0693p000009H6loAAC.png

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

The global variable ((Integer)globalMap.get("tConvertType_1_NB_LINE")) is available on the next subjob, eg:

...tConvertType--main--tHashOutput

|onsubjobok

tHashInpu--main--tDenormalizedSortRow....

 

on tDenormalizedSortRow, you can use the global variable ((Integer)globalMap.get("tConvertType_1_NB_LINE")), and it has value now.

 

But it is tJava_1 component which throws the NPE, can you show us the code on tJava_1?

View solution in original post

5 Replies
Anonymous
Not applicable

The global variable ((Integer)globalMap.get("tConvertType_1_NB_LINE")) is available on the next subjob, eg:

...tConvertType--main--tHashOutput

|onsubjobok

tHashInpu--main--tDenormalizedSortRow....

 

on tDenormalizedSortRow, you can use the global variable ((Integer)globalMap.get("tConvertType_1_NB_LINE")), and it has value now.

 

But it is tJava_1 component which throws the NPE, can you show us the code on tJava_1?

LDPtechAFB
Contributor III
Contributor III
Author

The Tjava error might be a mistake from me, the error is just

Exception in component tDenormalizeSortedRow_1

java.lang.NullPointerException

 

How can i do to have the NB of row from the tConvertType Component ?

0693p000009HKocAAG.png

 

Here is the current schema i used :

HashOutput are used because i can't use ExtractDelimitedField as Lookup for my tmap.

But you said that NB_LINE only work on the next subjob, so i have to use

tConvertType-->-->thashOutput --> thashInput--> tDenormalizedSortedRow-->tExtractDelimitedField --> thashOutput --> thashInput--> tmap ...etc

is it a good solution or multiply the thashobject are problematic ?

Thanks for your answer

Anonymous
Not applicable

((Integer)globalMap.get("tConvertType_1_NB_LINE")) return NULL value if you use it in the same flow, that's why you are getting NPE error. Can you share a full screenshot of your job?

 

LDPtechAFB
Contributor III
Contributor III
Author

Here is a full screenshot of my job 0693p000009HKppAAG.png

I followed your advices and the job work well.

My last question is :

Have a lot of thash component isn't a problem (concerning performance, quality ...etc) ?

in this case my thash input 9.10.11.12 free the datas after reading, so it should not be a problem but i prefer have your confirmation.

Thanks

 

Anonymous
Not applicable

Have a lot of tHash component in a job is't a problem, it depends on your data volume. Caching large amounts of data in the memory will affect performance, if the amount of data is not large, there is no significant performance difference.