Generate Row Number Field with multiple partition not workin

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
gowrishankar_h
Participant
Posts: 42
Joined: Wed Dec 26, 2012 1:13 pm

Generate Row Number Field with multiple partition not workin

Post by gowrishankar_h »

Hi All,

I use the following formula to generate the row number in sequence by using transformer stage with 2 partition.

(@INROWNUM - 1) * @NUMPARTITIONS + @PARTITIONNUM + 1

Say i have 100 record coming from input.up to 70 record the numer coming in sequence like below

1
2
3
4
.
.
.
70 but after 70 it is coming like

71
73
75
.
.
.
101

when i monitored i found the distribution in partition is not equal...Its there any way i can make partition as equal so generated number will be in sequence..My requirement should be in sequence....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What partitioning are you using? No, really using? Unless you can guarantee absolutely even distribution you will always see holes in the sequence. The only way that you can guarantee absolutely even distribution is (a) to specify Round Robin as the partitioning algorithm and (b) to have a number of rows that is an exact multiple of the number of partitions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gowrishankar_h
Participant
Posts: 42
Joined: Wed Dec 26, 2012 1:13 pm

Post by gowrishankar_h »

I use hash partition...so oly round robin will guarantee the equal distribution....
Post Reply