Six Stars

tHashInput component: The hash is not initialized

Hi,

 

I well know the reason of this error, of course.

I'm wondering if there are a way to avoid this error simply acting on the tHashInput component.

I explain: in my Job the execution flow does not always reachs the tHashInput component, for some reasons ("if" and different branches followed).

I would like that the subsequent tHashInput component treat this "hash not initialized" like a "hash initialized with zero rows", because the tHashInput is used as lookup-input-link for a tJoin and I would the treat it as "no lookup records available".

 

The only solution that came in my mind is to set-up one more tHashOutput crutch component, initialize it with a zero-row array in input, and then link (taking advantage of "Link with a tHashOutput" feature) my main tHashOutput component to the crutch one.

But this solution make me a bit sad, because in my Job I have 7-8 tHashOutput componentsto for which I should prevent the "hash not initialized" error.

 

tHashInput could have a flag (checkbox) to let it know to treat null hash as existing but empty hash. 

 

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Ten Stars

Re: tHashInput component: The hash is not initialized

OK, the only way of doing this is to pre-initialise the tHash components then. This is obviously not all that elegant (and I agree would be a great feature to be able to have the tHash components pre-intialised automatically if they are placed on the workspace), but I guess you sometimes have to put up with irritations like this when using a code generation tool. You *could* use a tJavaFlex and create your own data structure using Java (something I sometimes do if I need something special), but I suspect that is not necessary here.

Rilhia Solutions
5 REPLIES
Ten Stars

Re: tHashInput component: The hash is not initialized

I think your "crutch" is a good workaround, and you could initialize it in a prejob, much like you would a database connection. I also agree that an option to automatically initialize a hash or treat an uninitialized hash as empty would be appreciated.
Six Stars

Re: tHashInput component: The hash is not initialized

:-( 

my trick is not so satisfactory to me, because as I told I have to put one more tHashOutput component for each of my existing one. And since my job is based on uncouple few flow branches with Hash components, this trick makes my Job quite full of stuff :-(

 

 

Anymore idea?

Ten Stars

Re: tHashInput component: The hash is not initialized

Your tHashInputs that are linked to tHashOutput components that have not been initialised, I am assuming are the starting points of different subjobs. Is that correct? If so, can you not use RunIf links to link to them? Then in the IF condition use the "Number of line" globalMap variable for the tHashOutput it refers to, in order to work out if it should be used.

Rilhia Solutions
Six Stars

Re: tHashInput component: The hash is not initialized

Hi @rhall_2_0

no, some of the tHashInput components are in the middle of subjobs (i.e. the supply lookup rows for tJoin components), and those subjobs need to complete.

So, the tHashInput shoud execute, without failing.

Ten Stars

Re: tHashInput component: The hash is not initialized

OK, the only way of doing this is to pre-initialise the tHash components then. This is obviously not all that elegant (and I agree would be a great feature to be able to have the tHash components pre-intialised automatically if they are placed on the workspace), but I guess you sometimes have to put up with irritations like this when using a code generation tool. You *could* use a tJavaFlex and create your own data structure using Java (something I sometimes do if I need something special), but I suspect that is not necessary here.

Rilhia Solutions