Joining Columns with Different Column Names

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
hiteshm
Participant
Posts: 20
Joined: Tue May 10, 2005 5:32 am

Joining Columns with Different Column Names

Post by hiteshm »

Hi All,

I have a Parallel job where in I need to perform a join using join stage based on the Key values with different Column Names..

Eg: Emp_id with Manager_id

Can I perform the join on these fields in a join stage?

Rgds,
Hitesh
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

Use a copy stage in one of the input links and rename the join field Emp_id to Manager_id .
Last edited by Maveric on Mon Sep 10, 2007 6:03 am, edited 1 time in total.
iDomz
Participant
Posts: 81
Joined: Wed Jul 25, 2007 5:25 am
Location: London

Re: Joining Columns with Different Column Names

Post by iDomz »

hiteshm wrote:Hi All,

I have a Parallel job where in I need to perform a join using join stage..
Or lookup stage instead if data volume is not too high....
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Re: Joining Columns with Different Column Names

Post by JoshGeorge »

No, because join stage expects all the input links to have the same column name/s to consider for join key/s. Rename to one common name from one of the previous stages or as noted earlier introduce a new stage like copy stage for renaming. If any database stages are involved use alias.
hiteshm wrote: join using join stage based on the Key values with different Column Names..

Eg: Emp_id with Manager_id

Can I perform the join on these fields in a join stage?
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Joining Columns with Different Column Names

Post by SURA »

Hi,

For join stage key column name should be same. You can use a modify stage to change the column name input column (Emp_id) to output column (Manager_id) and then you can use the join stage.

Ram
hiteshm wrote:Hi All,

I have a Parallel job where in I need to perform a join using join stage based on the Key values with different Column Names..

Eg: Emp_id with Manager_id

Can I perform the join on these fields in a join stage?

Rgds,
Hitesh
Post Reply