Talend - How to do cross join in Talend tmap
We can very easily do cross join in tmap.
All we need to do is select your Main and Lookup flow into tMap and then expression Key section do not mention anything. Just do not mention any join condition. see below
tFixedFlowInput_1 - is fixed input for countryname - india, germany - resulting in two rows
tFixedFlowInput_2 - is fixed input for cityname - delhi,frankfurt - resulting in two rows,
tMap we input both tFixedFlowInput_1 and tFixedFlowInput_2 and then do not specify any join condition and result output is 4 rows (2X2) - cross join.
Output of job is below
Starting job jobforblog at 18:10 02/10/2013.
[statistics] connecting to socket on port 4006
[statistics] connected
.---------.
|tLogRow_2|
|=-------=|
|CityName |
|=-------=|
|DELHI |
|FRANKFURT |
'---------'
.-----------.
| tLogRow_1 |
|=---------=|
|CountryName|
|=---------=|
|INDIA |
|GERMANY |
'-----------'
.-----------+---------.
| tLogRow_3 |
|=----------+--------=|
|CountryName|CityName |
|=----------+--------=|
|INDIA |DELHI |
|INDIA |FRANKFURT |
|GERMANY |DELHI |
|GERMANY |FRANKFURT |
'-----------+---------'
[statistics] disconnected
Job jobforblog ended at 18:10 02/10/2013. [exit code=0]
[statistics] connecting to socket on port 4006
[statistics] connected
.---------.
|tLogRow_2|
|=-------=|
|CityName |
|=-------=|
|DELHI |
|FRANKFURT |
'---------'
.-----------.
| tLogRow_1 |
|=---------=|
|CountryName|
|=---------=|
|INDIA |
|GERMANY |
'-----------'
.-----------+---------.
| tLogRow_3 |
|=----------+--------=|
|CountryName|CityName |
|=----------+--------=|
|INDIA |DELHI |
|INDIA |FRANKFURT |
|GERMANY |DELHI |
|GERMANY |FRANKFURT |
'-----------+---------'
[statistics] disconnected
Job jobforblog ended at 18:10 02/10/2013. [exit code=0]
This comment has been removed by the author.
ReplyDeletei am doing cross join , but facing a problem of slow speed from the input to the tmap, its like 1 row/sec ,,,Please help .
ReplyDeletethere can be many factors contributing to slow rate...like volume of data, what is the next component after tmap and what is the batchsize(if applicable) defined for next component...what is the memory available to talend job..and many more..there is no one single bullet to fix this...you have to go step by step..and identify what is causing this slowness.
ReplyDelete