Joiner Transformation: Example: To Join EMP and DEPT Tables
Joiner Transformation: Example: To Join EMP and DEPT Tables
Connected and Active Transformation Used to join source data from two related heterogeneous sources residing in Different locations or file systems. Or, we can join data from the same source. If we need to join 3 ta les, then we need ! "oiner Transformations. The "oiner transformation joins two sources with at least one matching #ort. The "oiner transformation uses a condition that matches one or more #airs of $orts etween the two sources. Example: To join EMP and DEPT tables. %&$ and D%$T will e source ta le. Create a target ta le "OI'%()%*A&$+% in target designer. Ta le should Contain all #orts of %&$ ta le #lus D'A&% and +OC as shown elow. Create the shortcuts in your folder. Creating Mapping:
,. O#en folder where we want to create the ma##ing. !. Clic- Tools ./ &a##ing Designer. 3. Clic&a##ing./ Create./ 0ive ma##ing name. %12 m)joiner)e1am#le 3. Drag %&$, D%$T, and Target. Create "oiner Transformation. +in-
as shown elow. 4. 5#ecify the join condition in Condition ta . 5ee ste#s on ne1t #age. 6. 5et &aster in $orts ta . 5ee ste#s on ne1t #age. 7. &a##ing ./ 8alidate 9. (e#ository ./ 5ave. Create 5ession and :or-flow as descri ed earlier. (un the :or- flow and see the data in target ta le. &a-e sure to give connection information for all ta les. JOIN CONDITION:
The join condition contains #orts from oth in#ut sources that must match for the $ower Center 5erver to join two rows. Example: D%$T'O;D%$T'O, in a ove. ,. %dit "oiner Transformation ./ Condition Ta !. Add condition :e can add as many conditions as needed. Only ; o#erator is allowed. If we join Char and 8archar data ty#es, the $ower Center 5erver counts any s#aces that #ad Char values as #art of the string. 5o if you try to join the following2 Char <3=> ; ?a cd@ and 8archar <3=> ; ?a cd@ Then the Char value is ?a cd@ #added with 36 lan- s#aces, and the $ower Center 5erver does not join the two fields ecause the Char field contains trailing s#aces. Note: The "oiner transformation does not match null values. MASTE and DETAI! TA"!ES In "oiner, one ta le is called as &A5T%( and other as D%TAI+. &A5T%( ta le is always cached. :e can ma-e any ta le as &A5T%(. %dit "oiner Transformation ./ $orts Ta ./ 5elect & for &aster ta le. Ta le with less num er of rows should e made &A5T%( to im#rove $erformance. eason: :hen the $ower Center 5erver #rocesses a "oiner transformation, it reads rows from oth sources concurrently and uilds the inde1 and data cache ased on the master rows. 5o ta le with fewer rows will e read fast and cache can e made as ta le with more rows is still eing read. The fewer uniAue rows in the master, the fewer iterations of the join com#arison occur, which s#eeds the join #rocess. JOINE T ANS#O MATION P OPE TIES TA" Case$Sensiti%e String Comparison: If selected, the $ower Center 5erver uses case.sensitive string com#arisons when #erforming joins on string columns. Ca&'e Dire&tor(: 5#ecifies the directory used to cache master or detail rows and the inde1 to these rows. Join T(pe: 5#ecifies the ty#e of join2 'ormal, &aster Outer, Detail Outer, or Bull Outer. Tra&ing !e%el Joiner Data Ca&'e Si)e Joiner Index Ca&'e Si)e Sorted Inp*t JOIN T+PES
In 5C+, a join is a relational o#erator that com ines data from multi#le ta les into a single result set. The "oiner transformation acts in much the same manner, e1ce#t that ta les can originate from different data ases or flat files. T(pes o, Joins: 'ormal &aster Outer Detail Outer Bull Outer Note: A normal or master outer join #erforms faster than a full outer or detail outer join. Example: In %&$, we have em#loyees with D%$T'O ,=, !=, 3= and 4=. In D%$T, we have D%$T'O ,=, !=, 3= and 3=. D%$T will e &A5T%( ta le as it has less rows. Normal Join: :ith a normal join, the $ower Center 5erver discards all rows of data from the master and detail source that do not match, ased on the condition. All em#loyees of ,=, != and 3= will e there as only they are matching. Master O*ter Join: This join -ee#s all rows of data from the detail source and the matching rows from the master source. It discards the unmatched rows from the master source. All data of em#loyees of ,=, != and 3= will e there. There will e em#loyees of D%$T'O 4= and corres#onding D'A&% and +OC Columns will e 'U++. Detail O*ter Join: This join -ee#s all rows of data from the master source and the matching rows from the detail source. It discards the unmatched rows from the detail source. All em#loyees of ,=, != and 3= will e there. There will e one record for D%$T'O 3= and corres#onding data of %&$ columns will e 'U++. #*ll O*ter Join: A full outer join -ee#s all rows of data from oth the master and detail sources. All data of em#loyees of ,=, != and 3= will e there. There will e em#loyees of D%$T'O 4= and corres#onding D'A&% and +OC Columns will e 'U++. There will e one record for D%$T'O 3= and corres#onding data of %&$ Columns will e 'U++.
-SIN. SO TED INP-T Use to im#rove session #erformance. to use sorted in#ut, we must #ass data to the "oiner transformation sorted y the #orts that are used in "oin Condition. :e chec- the 5orted In#ut O#tion in $ro#erties Ta of the transformation. If the o#tion is chec-ed ut we are not #assing sorted data to the Transformation, then the session fails. :e can use 5O(T%( to sort data or 5ource Cualifier in case of (elational ta les. JOINE CAC/ES "oiner always caches the &A5T%( ta le. :e cannot disa le caching. It uilds Inde1 cache and Data Cache ased on &A5T%( ta le. 01 Joiner Index Ca&'e: All Columns of &A5T%( ta le used in "oin condition are in "OI'%( I'D%* CACD%. 2 Example: D%$T'O in our ma##ing. 31 Joiner Data Ca&'e: &aster column not in join condition and used for out#ut to other transformation or target ta le are in Data Cache. 2 Example: D'A&% and +OC in our ma##ing e1am#le. Per,orman&e T*ning: $erform joins in a data ase when #ossi le. "oin sorted data when #ossi le. Bor a sorted "oiner transformation, designate as the master source the source with fewer du#licate -ey values. "oiner canEt e used in following conditions2 ,. %ither in#ut #i#eline contains an U#date 5trategy transformation. !. :e connect a 5eAuence 0enerator transformation directly efore the "oiner transformation