Actually, in 0.8 the code you give will work, if you cast
min_generated to an int. 0.8 Is in the release process now. Are you
in a position to use new code?
Alan.
On Dec 14, 2010, at 10:32 AM, Jonathan Coveney wrote:
I'm not sure if Pig can handle this...perhaps in this specific case
there is
something more clever that can be done, although I think it points
to a
bigger question.
Basically, let's say I have (whatever:chararray, icare:int)
I want to get whatever, icare/min(all_of_icare), for each touple.
Basically
something akin to...
loaded = LOAD 'whatever' AS (whatever:chararray, icare:int)
min_generated = FOREACH loaded GENERATE icare;
min_group = GROUP min_generated ALL;
min = FOREACH min_group GENERATE MIN(min_generated);
generated = FOREACH loaded GENERATE whatever, icare/***min***;
obviously this code would not work, but I am wondering if something
in the
spirit of it can be done in Pig.
Thank you for your time
Jon