Hierarchical joins using tMap
The previous recipe covered the basics of tMap
joining, but tMap
has another level of joining capability, in that it can join together data in a hierarchical fashion. This simple example shows how easily this can be achieved using tMap
.
Getting ready
Open the job jo_cook_ch04_0080_hierarchicaltMapJoin
.
How to do it...
Open the
tMap
component. You will see three input tables.Select customerId from the
customer
table and drag it into Expr. key of thecustomerId
in the order table.You will see that a join link, a purple key symbol has been added to the column.
Change the tMap settings for the
order
table to Inner Join and All Matches (see previous recipe if you are not sure how to do this)Now, select
orderId
from theorder
table and drag it toorderId
in theorderItem
table.Change the tMap settings for the
orderItem
table to Inner Join and All Matches. ExittMap
and run the job.You should see a printed table containing denormalized customer/order/orderitem rows.