Skip to Content
Former Member
Oct 13, 2009 at 12:24 AM

sort according to another field order


say there are 2 input and 2 output fields

The first input field is mapped to the first output field , after grouping similar values together


input field1 output field1

a a

d a

e d

c d

d c

e e

a e

Now the 2 nd input field has to be mapped to 2nd output field according to the order in which the 1st field has been mapped.

We can not use sortByKey here as the first field is not mapped in lexographical nor numerical order.

How then can we map the 2nd field according to order of first?

Thanks in advance