Two Linked tHashedOutput Components

Eight Stars

Two Linked tHashedOutput Components

I have a tHashedOutput that is being created triggered by an iterate link. If the iterate link is not triggered, then the tHashedOutput does not exist. I need the next subjob to execute regardless, but it fails because the hash does not exist.

 

I have tried initializing the hash first by having another tHashedOutput linked to the same tHashedInput, but that also fails.

 

Any suggestions? I think I might need to stop using tHashedOutput and create a physical file instead.

Community Manager

Re: Two Linked tHashedOutput Components

Yes, this is a pain. I wish that all tHashOutputs were initialised by default if they are in the job. However, they are not. A way to get round this is to use a tFixedFlowInput with the same schema as the tHashOutput, to initialise the tHashOuput at the beginning of the job. Then the tHashOutput you use with your iterate link needs to be linked to the tHashOutput described above. The tFixedFlowInput doesn't need to return any rows (set it to 0 rows), it just needs to run. Any tHashInput components that are meant to use the data, should be linked to the tHashOutput used to initialise.

Employee

Re: Two Linked tHashedOutput Components

Hi,

 

    You are right that tHashInput will be looking for data from tHashOutput and if the data is not present or if the data is flushed out, then the hash input component will fail.

 

     If you would like to use Hash itself, then pass a dummy single row as an initial value for the hash. While retrieving, filter this dummy value out and process the rest of the items. This way, you can bypass the error.

 

     Or, you can go by using a temp file as you have mentioned.

 

     If the answer has helped you, could you please mark the topic as closed? Kudos are also welcome.

 

Warm Regards,

 

Nikhil Thampi

Employee

Re: Two Linked tHashedOutput Components

@rhall_2_0 .. saw your comment only after posting the reply.

Community Manager

Re: Two Linked tHashedOutput Components

@nikhilthampi no problem. I often start writing a reply and find I've said the same thing as someone who hit "Post" just before I did :-)

Employee

Re: Two Linked tHashedOutput Components

@rhall_2_0... Cheers :-) 

 

Eight Stars

Re: Two Linked tHashedOutput Components

I tried initializing another tHashedOutput that is also linked to the tHashedInput but that didn't work, so I went with the delimited file.
Community Manager

Re: Two Linked tHashedOutput Components

If you initialise a tHashOutput (lets call it tHashOutput_1) at the beginning of your job then link your other tHashOutput (tHashOutput_2) to that one (in that direction), then read from tHashOutput_1 when connecting your tHashInput, it definitely works. I use this all the time. 

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog