Hi, Here is a KB article describes the difference between tMap and tJoin. To me, tMap covers all the functionality of tJoin, so you can always use tMap. Best regards Sabrina
Hi all,
Here is an additional question by Vikram found on Twitter, I am inserting on the forum:
"Why should we use tJoin when we have a powerful component tMap?"
Best,
Pcoffre.
Thanks xdishi and pcoffre, Based on my research and experience, I am listing down what I have understood.
tJoin and tMap are quite different components, though tMap can be used to perform the same functionality as tJoin.
However, tMap is more powerful in terms of functionality. I am listing some of them as below:
1. tMap can have many outputs links as compared to tJoin which can have a main and reject links.
2. With tMap we can use expression on the columns while providing the joining condition. I think it is not possible for tJoin, Only exact match between the keys is possible.
3. In tMap we have option to store the intermediate data in the disc.
4. In tMap, we can enable the option to reload the lookup for every record.
Hence tMap is quite powerful component as compared to tJoin which is basic. Being a powerful component, it generates more code and it may take more space and time to load in the memory while compiling than tJoin. Hence, We should use tJoin if it suffice our requirements otherwise tMap.
Please let me know, your thoughts.
Hi
I would like to add the following points to Vikram's list:
5. tMap supports more types of join model, includes unique join, first join and all join, however, tjoin only support unique join.
6. tMap allows you to link multiple lookup flows to it, and supports to load multiple lookup flows parallel, however, tJoin only accept one lookup flow.
7. tMap supports 'die on error' option.
Shong
If you want to only use the rejects of a join (lookup), is it better to use tJoin and send the matched record to something like tLogRow and the rejects to your output file? Or is it better to use tMap and some kind of filtering in tMap to output only the exceptions to the join? (I could not figure out how to do this with tMap from the examples I found in the online help) Thanks for your discussions above!
As per my understanding if you require only rejects then you should use tJoin as its a simples componenet as compared to tMap. but if you have some filtering logic or complex logic then you should use tMap. to fetch the reject records you need to set the "Catch Output Rejects" to "true" for the tMap settings of output link.
Hi what is the difference in performance?
I can see tJoin puts the Lookup flow into memory. Does this tjoin do any internal sort on the main flow?. Does it sort the main flow in memory?
In regards to tmap if we write the lookups into disk. i can see the tmap doing an internal sort on them main flow. I will raise another thread regarding this