Page 1 of 1

Generate Row Number Field with multiple partition not workin

Posted: Wed Dec 25, 2013 9:26 am
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....

Posted: Wed Dec 25, 2013 4:41 pm
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.

Posted: Thu Dec 26, 2013 1:58 am
by gowrishankar_h
I use hash partition...so oly round robin will guarantee the equal distribution....