Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
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?
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?
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 ?
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
((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?
Here is a full screenshot of my job
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
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.