Lookup stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 134
- Joined: Tue Jun 15, 2010 2:10 am
- Location: Bangalore
Lookup stage
Hi ,
Please let me know whether the conception below is right.
If the primary and reference links have the same column names for non-key columns, then even though the reference column is pulled the data in it is the data from primary link's column.
Please let me know on this ....
Please let me know whether the conception below is right.
If the primary and reference links have the same column names for non-key columns, then even though the reference column is pulled the data in it is the data from primary link's column.
Please let me know on this ....
N.Srinivas
India.
India.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard.
You really haven't given enough information - I am presuming that your question refers to a Lookup stage.
The answer is "maybe". On the output link of the stage you can control which input columns get mapped to output columns.
You really haven't given enough information - I am presuming that your question refers to a Lookup stage.
The answer is "maybe". On the output link of the stage you can control which input columns get mapped to output columns.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 134
- Joined: Tue Jun 15, 2010 2:10 am
- Location: Bangalore
Question on Lookup stage
Sorry for not being clear.Here is my concern.Primary link has 2 columns EMP_ID ,EMP_NAME and Reference link has 2 columns EMP_ID and EMP_NAME.key to lookup is EMP_ID and EMP_NAME from reference is mapped to output.Though reference.EMP_NAME is mapped ,the data in that would be the data from primary link,is that true?[/quote]
N.Srinivas
India.
India.
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
Yes, because if the lookup fails (and you have Continue selected in the input link's Lookup Failure option) then you will get the stream's value and not the NULL of a failed lookup. You can map the lookup link's value to another field if you want, so that you can see which ones failed the lookup further downstream.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant
-
- Participant
- Posts: 134
- Joined: Tue Jun 15, 2010 2:10 am
- Location: Bangalore
-
- Participant
- Posts: 134
- Joined: Tue Jun 15, 2010 2:10 am
- Location: Bangalore
-
- Participant
- Posts: 437
- Joined: Fri Oct 21, 2005 10:00 pm
In your case continue would not be recommended. You should chose reject which would allow you to separate out your matched and unmatched records from the lookup.
You can then handle your rejects (set the empid and name to null or some other value) and then funnel the results together. In general this type of construct gives more visibility into what is occurring in the job. Many people prefer to continue and then handle the lookup failure in a downstream transformer. I prefer to lookup and reject, because it give more verbose information to whomever would be supporting the ETL I write.
You can then handle your rejects (set the empid and name to null or some other value) and then funnel the results together. In general this type of construct gives more visibility into what is occurring in the job. Many people prefer to continue and then handle the lookup failure in a downstream transformer. I prefer to lookup and reject, because it give more verbose information to whomever would be supporting the ETL I write.
Keith Williams
keith@peacefieldinc.com
keith@peacefieldinc.com
-
- Participant
- Posts: 134
- Joined: Tue Jun 15, 2010 2:10 am
- Location: Bangalore
Please pardon me for not being clear with the question from the beginning.
My question is only regarding the functionality of lookup stage only and not regarding any requirement.
If the primary and reference have same column name as per my previous question ,and reference.EMP_NAME is mapped to ouput,the data that flows to output is from stream.EMP_NAME though stream.EMP_NAME is not mapped to any of the output columns
My question is only regarding the functionality of lookup stage only and not regarding any requirement.
If the primary and reference have same column name as per my previous question ,and reference.EMP_NAME is mapped to ouput,the data that flows to output is from stream.EMP_NAME though stream.EMP_NAME is not mapped to any of the output columns
N.Srinivas
India.
India.
-
- Participant
- Posts: 437
- Joined: Fri Oct 21, 2005 10:00 pm
Interview question??
If you use continue and mapped the reference as the output, the result would be null if the lookup failed and you would have to handle it downstream.
Reject would only allow matches out the primary stream while creating a reject stream.
Fail would cause the entire job to fail.
If you use continue and mapped the reference as the output, the result would be null if the lookup failed and you would have to handle it downstream.
Reject would only allow matches out the primary stream while creating a reject stream.
Fail would cause the entire job to fail.
Keith Williams
keith@peacefieldinc.com
keith@peacefieldinc.com