This problem can be solved by using no of ways like JOIN stage with OUTER JOIN,Lookup stage and CDC stage.
In this solution, I will use Change Data Capture (CDC) stage.
Final job design would be like this:
My first input set records that has the records from 1 to 6.
My second input set records that has the records from 4 to 9.
Edit the CDC stage properties exactly like below.
Key = Key Column Name ( I have given column name as Key)
As we aware CDC stage expects before and after datasets, select the before and after datasets appropriately.
Just map the change_code and Key column to the output.
Change code =0 means Copy records
Change code =1 means Insert records
Change code =2 means Delete records
Put a constraint according to the change code values in transformer stage.
Compile and run the job.
Here are the three outputs: