Regarding JOIN Stage

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
krishna14
Participant
Posts: 24
Joined: Mon Jan 31, 2011 6:43 pm

Regarding JOIN Stage

Post by krishna14 »

All,

I got stuck with small issue on JOIN Stage,below is the secnario which i am trying to work on :

TABLE 1: DATA_KEY FIRST_DATA
1 A
2 B
3 C
2 D
4 E
TABLE 2: DATA_KEY LAST_DATA
1 v
2 w
3 x
2 y
4 z
DESIRED OUTPUT: DATA_KEY FIRST_DATA LAST_DATA
1 A V
2 B W
3 C X
2 D Y
4 E Z
For some reason i am not getting the desired output when i use the inner join (KeyColumn: DATA_KEY),my output which i am getting has lesser no: rows ...

Please guide me how can i over come the issue ....?
blewip
Participant
Posts: 81
Joined: Wed Nov 10, 2004 10:55 am
Location: London

Re: Regarding JOIN Stage

Post by blewip »

It's not entirely clear from your example, however the 1,2,3,2 appear to be the key. Both sides of the join need to be sorted on the key.

In which case they should appear 1,2,2,3

Duplicates in the key will duplicate the output, there should be 4 output records of key 2.
Modern Life is Rubbish - Blur
soumya5891
Participant
Posts: 152
Joined: Mon Mar 07, 2011 6:16 am

Re: Regarding JOIN Stage

Post by soumya5891 »

You need to make a hash partition on each input link in the same order.The order of the hash keys will be same as join keys
Soumya
mobashshar
Participant
Posts: 91
Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.

Re: Regarding JOIN Stage

Post by mobashshar »

soumya5891 wrote:You need to make a hash partition on each input link in the same order.The order of the hash keys will be same as join keys
Soumya is right. Just hash partition and also sort your input key column
krishna14
Participant
Posts: 24
Joined: Mon Jan 31, 2011 6:43 pm

Post by krishna14 »

Thanks , i did work what soumya suggested ....i got the desired output..Thanks all .i apperciate your response soumya.
krishna
blewip
Participant
Posts: 81
Joined: Wed Nov 10, 2004 10:55 am
Location: London

Re: Regarding JOIN Stage

Post by blewip »

blewip wrote:Both sides of the join need to be sorted on the key.
Thanks Soumya

So that's how you do a Sort
Modern Life is Rubbish - Blur
Post Reply