Join - dealing with different input 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
juliank
Premium Member
Premium Member
Posts: 9
Joined: Tue Oct 30, 2007 12:52 pm

Join - dealing with different input column names

Post by juliank »

What are the best practices for dealing with joins where the incoming column names don't match? Is there more than one approach? I thought that renaming column(s) under the input tab for a join will work, but it doesn't. If this is the case, which stage(s) are best suited to do this?

Thanks for any input!
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Renaming the column in prior stages where its permisible to rename like, Transformer, modify etc,.
Or Lookup and do a lookup with different column names.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
juliank
Premium Member
Premium Member
Posts: 9
Joined: Tue Oct 30, 2007 12:52 pm

Post by juliank »

Thanks!

Do you maybe know what is the point of allowing to rename column names in a join (Input -> Columns), but not being able to take advantage of it? Maybe I am missing something.

Also, is there a performance penalty for using one or the other stage for something simple like renaming columns?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

It is not stage but in the link that connects Join and the prior stage. If you rename the column in Join input stage, output stage of the previous gets changed, and hence the actual rename is happening in the previous stage.
More the stage, more the resource been consumed. There are few stages with less/No resource consumption like Copy stage etc.,
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
juliank
Premium Member
Premium Member
Posts: 9
Joined: Tue Oct 30, 2007 12:52 pm

Post by juliank »

kumar_s wrote: ... If you rename the column in Join input stage, output stage of the previous gets changed, and hence the actual rename is happening in the previous stage.
Agree. So if a rename was made, and I see it, why wouldn't it be enough to accomplish now a join on columns that have identical names on the input stage of the join? I am just trying to understand. Maybe I am missing something.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Are you getting any error or warning? What is the stage prior to the Join stage?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
juliank
Premium Member
Premium Member
Posts: 9
Joined: Tue Oct 30, 2007 12:52 pm

Post by juliank »

kumar_s wrote:Are you getting any error or warning? What is the stage prior to the Join stage?
I don't get any error during the design stage. When I pull down the menu for keys to join, the list is blank even that I changed the input names to match where required. I don't know whether this a bug, or something that I just need to learn.

In this case there are three inputs into this join. The sources for these inputs are two joins and one dynamic rdbms source (table).
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

It should show up the column names if they match in the pull down box for key list. Check carefully for spelling in each link. If you are using the same metadata, try to save one and reload into other link.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Copy is the cheapest stage for renaming 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.
John Smith
Charter Member
Charter Member
Posts: 193
Joined: Tue Sep 05, 2006 8:01 pm
Location: Australia

Post by John Smith »

juliank wrote:
kumar_s wrote: ... If you rename the column in Join input stage, output stage of the previous gets changed, and hence the actual rename is happening in the previous stage.
Agree. So if a rename was made, and I see it, why wouldn't it be enough to accomplish now a join on columns that have identical names on the input stage of the join? I am just trying to understand. Maybe I am missing something.
Yes but are those columns defined as Keys ?
Post Reply