Page 1 of 1

Max Value from each partition

Posted: Mon Apr 07, 2008 10:17 am
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

Posted: Mon Apr 07, 2008 3:25 pm
by ray.wurlod
An Aggregator stage or a Transformer stage can give you the maximum from each partition.

Posted: Mon Apr 07, 2008 6:14 pm
by Nripendra Chand
you can use '@NUMPARTITIONS' system variable in transformer stage to know the number of partitions.