Friday, 16 August 2013

Talend Tmap Join

About tMap

In Talend tMap is very important component. It is used in map source(s) and destination(s).

It contains the following features.
  • Extract data from multiple sources using with join (Inner Join / Left outer Join)
  • Loading data into multiple destinations
  • Applying different types of transformations to data
  • Applying filter conditions for source / destination data
  • Type casting
  • Capture Reject records
To extract the data from multiple sources we need to join sources. While join the sources we can change tMap settings in that four type of settings are available
  1. Lookup Model (Load once/ Reload at each row/ Reload at each row (Cache))
  2. Match Model (Unique Match/ First Match/ Last Match)
  3. Join Model (Inner Join/ Left outer join
  4. Store Temp Data (True/ False)

Match Model:

This option is useful whenever you have multiple records in "LookUp" table. The following options are available in Match Model

  1. Unique Match  :    It will match with last record of the look up table.
  2. First Match      :    It will match with first record of the loop up table
  3. All Matches     :    It will match with all records with the loop up table
My Video about Match models

The following example will explain you about "Match Models" under tMap component

Suppose I have data like following

Main File

CustomerID CustomerName AddressID
1
Pivot Point College
1001
2
Petes Auto Repaire
1002
3
Green Bay Travel Services
1003
4
BBQ Smith's Tex Mex
1004
5
janice Mann Accounting Service
1005
6
Bee Line Publishing
1006
7
Vanity Town
1007
8
Resnick DDS
1008
9
Michael Montgomery Hair Saloon
1009
10
Nitelites Party Rental
1010
11
Acturial Enterprises Ltd.

Lookup File

AddressId Address
1001
12 Craven Way
1001
929 Brittany Ave.
1002
45 South Deer Creek Drive
1003
11486 Oakwood
1004
3181 Barkwood Ct.
1005
242 Ashland Ave.
1006
3059 Priscilla Court
1007
965 Marion Place Apt. 65C
1008
1535 Knollwood Drive
1009
1658 Second St.
1010
511 Maple Ave. Apt. 1B
    tMap Settings Image

Unique Match Output

CustomerID CustomerName AddressID Address
1
Pivot Point College
1001
929 Brittany Ave.                
2
Petes Auto Repaire
1002
45 South Deer Creek Drive
3
Green Bay Travel Services
1003
1486 Oakwood
4
BBQ Smith's Tex Mex
1004
3181 Barkwood Ct.
5
janice Mann Accounting Service
1005
242 Ashland Ave.
6
Bee Line Publishing
1006
3059 Priscilla Court
7
Vanity Town
1007
965 Marion Place Apt. 65C
8
Resnick DDS
1008
1535 Knollwood Drive
9
Michael Montgomery Hair Saloon
1009
1658 Second St.
10
Nitelites Party Rental
1010
511 Maple Ave.  Apt. 1B

First Match output

CustomerIDCustomerNameAddressIDAddress
1
Pivot Point College
1001
12 Craven Way                    
2
Petes Auto Repaire
1002
45 South Deer Creek Drive
3
Green Bay Travel Services
1003
1486 Oakwood
4
BBQ Smith's Tex Mex
1004
3181 Barkwood Ct.
5
janice Mann Accounting Service
1005
242 Ashland Ave.
6
Bee Line Publishing
1006
3059 Priscilla Court
7
Vanity Town
1007
965 Marion Place Apt. 65C
8
Resnick DDS
1008
1535 Knollwood Drive
9
Michael Montgomery Hair Saloon
1009
1658 Second St.
10
Nitelites Party Rental
1010
511 Maple Ave.  Apt. 1B

All Matches Output

CustomerIDCustomerNameAddressIDAddress
1
Pivot Point College
1001
12 Craven Way                    
1
Pivot Point College
1001
1929 Brittany Ave.               
2
Petes Auto Repaire
1002
45 South Deer Creek Drive
3
Green Bay Travel Services
1003
1486 Oakwood
4
BBQ Smith's Tex Mex
1004
3181 Barkwood Ct.
5
janice Mann Accounting Service
1005
242 Ashland Ave.
6
Bee Line Publishing
1006
3059 Priscilla Court
7
Vanity Town
1007
965 Marion Place Apt. 65C
8
Resnick DDS
1008
1535 Knollwood Drive
9
Michael Montgomery Hair Saloon
1009
1658 Second St.
10
Nitelites Party Rental
1010
511 Maple Ave.  Apt. 1B

No comments:

Post a Comment