|
|
+
Matt Tanquary 2010-10-20, 19:41
-
Re: Using alias results in future calculations?Aniket Mokashi 2010-10-20, 19:55
In pig 0.8, you can say,
P = foreach G generate G.$0 * C.$0, G.$1; Other methods are discussed here- https://issues.apache.org/jira/browse/PIG-1434 Thanks, Aniket On Wed, October 20, 2010 3:41 pm, Matt Tanquary wrote: > I need to use the output of one alias in a future calculation: > > > Suppose I have: > > > C=(5) > > > and then later, I have > > G=(1,A) > (3,B) > (5,C) > > > then I want to do a foreach on G where I multiply each G.$0 by C.$0, > ending up with > > H=(5,A) > (15,B) > (25,C) > > > how can I do that? > > I did accomplish it by doing a CROSS against the two tables and then > running foreach against that, but I want to avoid using CROSS. > > Thanks for any ideas! > -M@ > > > -- > Have you thanked a teacher today? ---> http://www.liftateacher.org > > |