I have to assign unique numbers to records in a buildop stage. How can i ensure that the numbers generated in all tha partitions are unique? Is there any way to get the partition number in C++ code i have written.
Rajesh
Random number generation in buildop
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 24
- Joined: Sat Oct 15, 2005 1:09 pm
Random number generation in buildop
Regards,
Rajesh
Rajesh
Why do you need to assign it within the buildop? You could use a Surrogate Key Generator (or more generically, a Column Generator) to add a unique sequence number to the row.
There are quite a few posting out there for "Surrogate Key Generator" and "Column Generator" if that would suit your needs.
Brad.
There are quite a few posting out there for "Surrogate Key Generator" and "Column Generator" if that would suit your needs.
Brad.
-
- Participant
- Posts: 24
- Joined: Sat Oct 15, 2005 1:09 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
You can assign numbers in the transformer stage using the FAQ on How do I set up a counter in a parallel transformer? You just need to sort and partition on that number field and only increment the parallel counter when the key number field changes. You can do this with a lastkey stage variable for comparison.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
-
- Participant
- Posts: 24
- Joined: Sat Oct 15, 2005 1:09 pm