Search code examples
jointalend

Talend Open Studio (6.5.1) tMap join with <= / >= condition


My problem is joining 2 tables in a Talend(Open Studio 6.5.1) process, but I cannot realize the join condition.

I use a tMap component to do the join. I know that I can do a lookup on all the data (cartesian product) and then use the expression filter, but that is NOT what I want, because of table sizes. I use a join based on one equal (=) condition and two greater/less than equal (>=, <=) conditions on the lookup table (see code below). But if I run my job the result gives me data with Null rows (see screenshot too). I need to know how I can realize a join condition in Talend like in the code below.

I hope the following screenshots show it a bit cleraly what I expect from my Talend Job.

My data looks like follows: on top the 2 tables for join and the wished result

But this is the result I get: Actual result

This is the join Iam trying to realize:

from DWH_PROD.hp_test_tMapConditions t1 
join DWH_PROD.hp_test_tMapConditions_lookup t2
    on t1.ID = t2.ID 
    and t1.datum >= t2.von 
    and t1.datum <= t2.bis

My talend process: Talend process

And my tMap with conditional filter: tMap expression filter


Solution

  • Try to change the Joint Model to Inner Joint to eliminate the null values.

    enter image description here