Max Value from each partition

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
r_arora
Participant
Posts: 20
Joined: Tue Mar 04, 2008 10:30 am

Max Value from each partition

Post by r_arora »

Hello,

I have a scenario where I want the maximum date from each partition.And from the set of rows I get, I have to get the maximum of that date and write it to a dataset. For example, If I have 4 partitions I will get 4 max dates, then I will sort these set of 4 dates and get the maximum out of these 4.

My source is about 9 million records. And I need to process only these 4 records to get the MAXDATE after the transformer from these 9 million records.
My question is, how will I know the number of partitions and how will I get the maximum value from each partition.
Any help will be appreciated.
Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

An Aggregator stage or a Transformer stage can give you the maximum from each partition.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nripendra Chand
Premium Member
Premium Member
Posts: 196
Joined: Tue Nov 23, 2004 11:50 pm
Location: Sydney (Australia)

Post by Nripendra Chand »

you can use '@NUMPARTITIONS' system variable in transformer stage to know the number of partitions.
-Nripendra Chand
Post Reply