Page 1 of 1

how to get minimum value without using aggregator stage

Posted: Mon Nov 15, 2010 3:44 am
by skyboyfli
I hve the data like this

Deptno sal
-------- -------
10 3000
10 234000
10 3434
20 3547
30 4544
40 4656
40 3434
20 5767

I neet to get deptno with minimum sal ..... but without using aggregator!

Thanks in advance.

Re: how to get min sal without using aggregator stage

Posted: Mon Nov 15, 2010 4:18 am
by sureshbabu
friest filer basend on depno, then sort ase order on sal then the both depno and sal and using copy pass only one

Posted: Mon Nov 15, 2010 4:41 am
by swathi Singamareddygari
Hi,

1)First sort the data based on Deptno and Sal in ascending order by using sort stage
2)After that use the remove duplicate stage and set Duplicates to retain to First

Re: how to get min sal without using aggregator stage

Posted: Mon Nov 15, 2010 2:05 pm
by ray.wurlod
sureshbabu wrote:friest filer basend on depno, then sort ase order on sal then the both depno and sal and using copy pass only one
Please replace your keyboard with one that can spell!

Re: how to get min sal without using aggregator stage

Posted: Mon Nov 15, 2010 8:03 pm
by stuartjvnorton
skyboyfli wrote:I hve the data like this

Deptno sal
-------- -------
10 3000
10 234000
10 3434
20 3547
30 4544
40 4656
40 3434
20 5767

I neet to get deptno wise min sal ..... but without using aggregator!

Thanks in advance.

Job interview?

Posted: Mon Nov 15, 2010 11:04 pm
by ray.wurlod
Job interview leading to min sal ?
:wink:

Posted: Wed Nov 17, 2010 3:11 am
by skyboyfli
swathi Singamareddygari wrote:Hi,

1)First sort the data based on Deptno and Sal in ascending order by using sort stage
2)After that use the remove duplicate stage and set Duplicates to retain to First
im having 6 nodes system..
so sorting of two columns not giving expected results...

how to do this in multinode system

Posted: Wed Nov 17, 2010 3:38 am
by ArndW
If you get incorrect values with multiple nodes then you have partitioned incorrectly. You need to partition on DEPTNO.

Posted: Wed Nov 17, 2010 3:42 am
by ray.wurlod
ArndW wrote:If you get incorrect values with multiple nodes then you have partitioned incorrectly. You need to partition on DEPTNO.
... using a key-based partitioning algorithm, for example Modulus or Hash.

done

Posted: Wed Nov 17, 2010 5:07 am
by skyboyfli
swathi Singamareddygari wrote:Hi,

1)First sort the data based on Deptno and Sal in ascending order by using sort stage
2)After that use the remove duplicate stage and set Duplicates to retain to First
i made the sort stage in sequential mode....
and i got expected data

Thanks

Posted: Wed Nov 17, 2010 8:36 am
by asorrell
That may work, but it isn't technically the best way to write your job. If you want to be a good PX developer, you need to learn how partitioning works. Turning it off because you don't understand it just makes for slow jobs.