Doubt in 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
Madhav_M
Participant
Posts: 43
Joined: Sat Jul 10, 2004 5:47 am

Doubt in Join Stage

Post by Madhav_M »

Hi
I am having 3 input links to a join stage and an output link.
I there is any possibility of getting more rows in the output than the input links. ie, if total rows of input links of join stage is 100 and output link of join can be more than 100.

Expecting ur assitance
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Madhav,

It depends on the type of join. What is the type of join you have defined for your join stage? Why are you using 3 input links. Pls give more details. It will help others share their experiences.

HTH
--Rich

Pride comes before a fall
Humility comes before honour
Madhav_M
Participant
Posts: 43
Joined: Sat Jul 10, 2004 5:47 am

Post by Madhav_M »

I'm using Left Outer Joing.
In the first link i'm taking fields without transformation(Asis) from table1 and table2
in the second link calculating a measure from table1 and table3
and in the 3rd link caluculating some more measure from table1 and table4
I have common keys also :(
bobyon
Premium Member
Premium Member
Posts: 200
Joined: Tue Mar 02, 2004 10:25 am
Location: Salisbury, NC

Re: Doubt in Join Stage

Post by bobyon »

I can't think of any way you would get more rows than the total number of rows coming in. Even using a full outer join would not "create" additional rows.

HTH
Bob
Bob
leo_t_nice
Participant
Posts: 25
Joined: Thu Oct 02, 2003 8:57 am

Post by leo_t_nice »

Hi

Yes it is possible to get more rows out than went in... It is the same as SQL if you dont make the full join between tables. I think its called a cartesian product.

For example you could have 2 records in one table and 2 records in the join table and get 4 rows out (for each row in the first table, you get 2 rows from the join table).

If you are getting more rows out, then you probably need to look at which fields you are specifying in the join stage. I guess you have something missing from the key specification.

Hope this helps
L
Madhav_M
Participant
Posts: 43
Joined: Sat Jul 10, 2004 5:47 am

Post by Madhav_M »

Thanks a lot for ur assitance.
dsxdev
Participant
Posts: 92
Joined: Mon Sep 20, 2004 8:37 am

Post by dsxdev »

From my experience, a Join Stage works same as a Database join (output wise). There is every possibility of getting output no of records more than in put.

You are dong a left outer join
Suppose you have 10 input records(left link) and 6 records on right link.
Out of these 6 records 3 records match with 4 records on left link and out of the 3 records on right link two records have same values for key columns 2 records on left link match these values.
Then your output will be
6 non matching records + 2(on left link) *2(on right link) + 2(left link)*1(right link)=12 records.

if you are getting more than this then the problem would be some where else.
Happy DataStaging
Post Reply