Five Stars

tMap lookups a joblet

Hi folks,

 

I am new to talend. I have got a question regarding the tMap component and joblets. In order to devide (and conquere) our extraction jobs I have created some atomic joblets which deliver me the first source database objects for further transformations. Well, this part works very well!

 

The main question is now, whether I am able to use this predefined joblets for extraction as lookups within my tMap definition?

 

Lets make it more clear with a picture:

 

talend_tmap_meets_joblet.png
A little bit explanation

  • The extraction joblets got some technical primary key as input (INPUT_1).
  • With these keys the joblet returns the raw database objects in order to manipulate and transform them to a sort of business objects (next process). 
  • The extraction joblet is responsible to provide the data --> encapsulation
  • The "Input_1" of the joblets are based on a generic schema which provides some attributes (also the technical key) to grep the record you need. I call it "param" (e.g. param.recid, param.key_1, param.key_2, ...)
  • The tOracleInput components apply predefined SQLs from my meta model. For instance:

talend_tmap_meets_joblet.png

  • The "param" records references the INPUT_1 generic schema I have already mentioned

The mission:

  • How can I configure the tMap (or another mapping component) that way that it uses my extraction joblet instead an independent fetch logic (SQL) as lookup?
  • I should mention: I am a friend of "Don't Repeat Youself" what descripts best my motivation trying to do it that way Smiley Happy.

Additionals:

  • Something that might go in the right direction I could find in the talend referance guide.

I appreciate any help

 

Cheers

Adam L.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Five Stars

Re: tMap lookups a joblet

HI Shong

thanks for your post. I have tried to reconstruct my job as you desribed. I guess that there is another problem which I do not really understand.

 

Have a closer look at the child job implemented as advised:

 

Unbenannt.png

The tFixedFLowInput components set some dummy parameter. My log shows what I assumed to generate.

Unbenannt.png

  1. We got from the jl_e_sk_fahrzeug_1 joblet our record identified by the tFlixedFlowInput_1 parameter. Check! Thats the second log entry.
  2. We also got a record of the jl_e_skp_firma_1 joblet. Perfactly. Thats the first log entry.

Now I dive into the tMap component. Any here it becomas a little miraculous!

 

Unbenannt.png

I got some compilation errors!:

 

Unbenannt.png

 

Any ideas? 

 

Cheers

Adam L.

 

 

 

 

Five Stars

Re: tMap lookups a joblet

Ok got it!!! My mistake:

The problem were incompatible attribute types. I wanted to press an integer into a string type! That was the error. Now, everything seams to work.

BTW: Just for other newbies hovering the underlined fragments in the code tab brings me to the solution.

Thanks and best regards
Adam L.
4 REPLIES
Community Manager

Re: tMap lookups a joblet

Hello
You need to redesign the job as below so that you are able to access param value in the lookup flow.
main job:
tFixedFlowinput--main--tflowtoiterate--trunjob

trunjob: call the child job and pass the current values to child job.

child job:
tfixedflowinput-1-main--tjoblet1--tmap1--tlogrow
                                                      |
                                                 lookup
                                                     |
                              tfixedflowinput2-main-tjoblet2
tfixedflowinput1, tfixedflowinput2 generate the current values passed from main job.

Regards
Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: tMap lookups a joblet

HI Shong

thanks for your post. I have tried to reconstruct my job as you desribed. I guess that there is another problem which I do not really understand.

 

Have a closer look at the child job implemented as advised:

 

Unbenannt.png

The tFixedFLowInput components set some dummy parameter. My log shows what I assumed to generate.

Unbenannt.png

  1. We got from the jl_e_sk_fahrzeug_1 joblet our record identified by the tFlixedFlowInput_1 parameter. Check! Thats the second log entry.
  2. We also got a record of the jl_e_skp_firma_1 joblet. Perfactly. Thats the first log entry.

Now I dive into the tMap component. Any here it becomas a little miraculous!

 

Unbenannt.png

I got some compilation errors!:

 

Unbenannt.png

 

Any ideas? 

 

Cheers

Adam L.

 

 

 

 

Five Stars

Re: tMap lookups a joblet

Ok got it!!! My mistake:

The problem were incompatible attribute types. I wanted to press an integer into a string type! That was the error. Now, everything seams to work.

BTW: Just for other newbies hovering the underlined fragments in the code tab brings me to the solution.

Thanks and best regards
Adam L.
Community Manager

Re: tMap lookups a joblet

Great! Thanks for your feedback!

----------------------------------------------------------
Talend | Data Agility for Modern Business