How do I find the MAX
of a tuple in Pig?
My code looks like this:
A,20
B,10
C,40
D,5
data = LOAD 'myData.txt' USING PigStorage(',') AS key, value;
all = GROUP data ALL;
maxKey = FOREACH all GENERATE MAX(data.value);
DUMP maxKey;
This returns 40, but I want the full key-value pair: C,40
. Any ideas?