Skip to main content

Joiner Transformation in Informatica




·         Active Transformation
·         Joiner relates two or more tables.
·         It allows homogeneous or heterogeneous sources.
·         Join Types

NORMAL (Equijoin – default)
            OUTER
ΓΌ  Master Outer
ΓΌ  Detail Outer
ΓΌ  Full Outer
·         Does not allow non-equi joins.

Join Types

 

Equi-Join


Example

EMP (DETAIL )
Empno ename sal deptno
1 x 2000 10
2 y 3000 20
3 z 1000 10
4 A 3000

DEPT (MASTER)
DEPTNO   DEPTNAME
10              HR
20              FI
30             SALES

Equi-Join  (3 Records)

1 x 2000 10 HR
2 y 3000 20 FI
3 z 1000 10 HR



MASTER OUTER


Equi-Join + Remaining Records of Detail (4 records)

1 x 2000 10 HR
2 y 3000 20 FI
3 z 1000 10 HR
4 A 3000

Detail Outer

Equi-Join + Remaining Records of MASTER (4 records)

1 x 2000 10 HR
2 y 3000 20 FI
3 z 1000 10 HR
                30 SALES

Full Outer

Equi-Join + Remaining Records of MASTER + Remaining Records of Detail (5 records)

1 x 2000 10 HR
2 y 3000 20 FI
3 z 1000 10 HR
                30 SALES
4 A 3000

Interview Question for JOINER

Does JOINER allow non-equi-join?
Ans: NO It does not allow non-equi-joiN.









Create a table DIM_JOIN in the DWH_MEEN schema.

CREATE TABLE DIM_JOIN AS
SELECT * FROM EMP
WHERE 1=2;

Table structure only gets copied.

Alter the table and add a new column DNAME.

SQL> ALTER TABLE DIM_JOIN
         ADD DNAME VARCHAR2(30);

Table altered.

SQL> DESC DIM_JOIN;
 Name                                                  Null?    Type
 ----------------------------------------------------- -------- ---------------
 EMPNO                                                          NUMBER(4)
 ENAME                                                          VARCHAR2(10)
 JOB                                                            VARCHAR2(9)
 MGR                                                            NUMBER(4)
 HIREDATE                                                       DATE
 SAL                                                            NUMBER(7,2)
 COMM                                                           NUMBER(7,2)
 DEPTNO                                                         NUMBER(2)
 DNAME                                                          VARCHAR2(30)

SQL> COMMIT;




Import that table in the Warehouse Designer.







SQL> select * from scott.emp;

     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
      7566 JONES      MANAGER         7839 02-APR-81       2975                    20
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
      7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
      7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
      7839 KING       PRESIDENT            17-NOV-81       5000                    10
      7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
      7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
      7900 JAMES      CLERK           7698 03-DEC-81        950                    30

     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
      7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
      9999 MONA       ANALYST         7566 06-AUG-09       2000

14 rows selected.

SQL> select * from scott.dept;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
        50 SUPPORT        BANGALORE
        60 DISTRIBUTION   DELHI
        70 EDUCATION      CHENNAI
        80 XYZ            ABC

8 rows selected.




STEPS:
1.      Define Sources (EMP,DEPT)
2.      Define Target (DIM_JOIN)
3.      Define Mapping  (M_JOIN)– Drag two sources and one target in Mapping Designer Workspace.
4.      From the Transformation Menu select JOINER and create. T_JOIN
Drag the required ports from two source qualifiers to the JOINER.
Note: The first input to JOINER becomes Master and next Detail. (??? I got the detail as detail and master as master only )



Go to JOINER,edit – go to PORTS tab and select master port for deptno,dname and loc.
Ports: Input,Output,MAster

Go to the Conditions tab and add a new condition.






Go to the Condition Tab and add a condition.
From the master table and detail table select the common column.
(Common column with common data type and size)
We can also add multiple conditions in a JOIN condition.



Properties:

·         Data Cache
·         Index Cache is going to use JOIN condition.
·         Sorted Input
·         Join Type
·         Join Condition
·         Cache Directory
·         Case sensitive string comparison
·         Join Type : NORMAL
·         NULL ordering in MASTER/DETAIL (By default it is high – NULL values will come at the bottom)


     



Project the required ports from JOINER to TARGET.
Validate the mapping.
Repository -> Save

Define session, workflow WF_JOIN.
Start workflow and preview the output.




NOTE: For JOINER and some other transformations, we can edit the properties at the Session    level also.
Edit the Session and go to Mappings tab.
Select Transformations.




Master outer
(Equijoin + Remaining records of Detail Table)
Select the Join Type as Master Outer.
Repository -> Save.



Output (13 + 1)



DETAIL OUTER JOIN
Equijoin + Remaining Records of Master Table
(13 + 5 = 18)

Repository -> Save



Output:





FULL OUTER JOIN
(Equijoin + Remaining Records of Master + Remaining Records of Detail)
(13 + 5 + 1 = 19)
Output:

Comments

Popular posts from this blog

Contact Me

Do You have any queries ?                   If you are having any query or wishing to get any type of help related Datawarehouse, OBIEE, OBIA, OAC then please e-email on below. I will reply to your email within 24 hrs. If I didn’t reply to you within 24 Hrs., Please be patience, I must be busy in some work. kashif7222@gmail.com

Top 130 SQL Interview Questions And Answers

1. Display the dept information from department table.   Select   *   from   dept; 2. Display the details of all employees   Select * from emp; 3. Display the name and job for all employees    Select ename ,job from emp; 4. Display name and salary for all employees.   Select ename   , sal   from emp;   5. Display employee number and total salary   for each employee. Select empno, sal+comm from emp; 6. Display employee name and annual salary for all employees.   Select empno,empname,12*sal+nvl(comm,0) annualsal from emp; 7. Display the names of all employees who are working in department number 10   Select ename from emp where deptno=10; 8. Display the names of all employees working as   clerks and drawing a salary more than 3000   Select ename from emp where job=’clerk’and sal>3000; 9. Display employee number and names for employees who earn commissi...

Top 100 Informatica Interview Questions

I have attended Informatica interview last week in wipro and couple of other companies, Question below I faced in those companies. 1. What are the main issues while working with flat files as source and as targets ? 2. Explain about Informatica server process that how it works relates to mapping variables? 3. write a query to retrieve the latest records from the table sorted by version(scd) 4. How do you handle two sessions in Informatica 5. which one is better performance wise joiner or look up 6. How to partition the Session? 7. How many types of sessions are there in informatica.please explain them. 8. Explain the pipeline partition with real time example? 9. Explain about cumulative Sum or moving sum? 10. CONVERT MULTIPLE ROWS TO SINGLE ROW (MULTIPLE COLUMNS) IN INFORMATICA 11. DEPLOYMENT GROUPS IN INFORMATICA 12. LOAD LAST N RECORDS OF FILE INTO TARGET TABLE - INFORMATICA 13. LOAD ALTERNATIVE RECORDS / ROWS INTO...