I'm using Talend to do a joint operation between two tables in order to get all match records.
Here is my tables:
So the logic is like this one. A person can have a carrer number X10
witch start form 01-01-2000
to 31-12-2000
.
In the other side, i have multiple interruptions related to this carrer X10
X10
from 01-02-2000
to 05-02-2000
X10
from 05-06-2000
to 05-07-2000
X10
from 30-10-2000
to 01-11-2000
I have a function that accept two parameter ( carrer car, interruption inter ) I use this function to split the carrer interval with the interruption interval to get only a carrer without interruption
for example
01-01-2000
to 31-12-2000
with
05-02-2000
to 07-02-2000
As output function i get this one:
01-01-2000
to 04-02-2000
05-02-2000
to 07-02-2000
carrer two : start date 08-02-2000
to 31-12-2000
My program work fine, when i have only one interruption related to a carrer.
when i have Multiple interruptions, the function will get all records ( all match rows row by row ) like this
carrer X Interruption I1 -> to my function ()
carrer X Interruption I2 -> to my function ()
carrer X Interruption I3 -> to my function ()
In this case all the logic will be incorrect as the carrer is not updated after the first split with the first interruption as always we pass the same carrer X 3 time to my function.
My question is is there a way to pass all matches in one shoot to my function Like this
carrer X , List<interruption> -> to my function
I found out a way to get a list of rows that ( all the interrupt lines that correspond to the main line). This is done with the tAggregateRow component.
here is the new schema :
I used two list to group all start DATE and end DATE that much the same carrer.
and there is my final tmap shcema.