Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> add a field, ordered


Copy link to this message
-
add a field, ordered
I  want to match up tuples from 2 relations. For each key, the 2 relations
will always have the same number of tuples and match by position (the first
tuple in each are a match, the second tuple in each, etc).

so if I have
relation1 = 5,9,7
relation2 = z,a,d

I want to end up with

relation3 = (5,z),(9,a),(7,d)

I figure I need a way to generate a matching key on the ordered tuples of
the relations and then do a cogroup. But I'm stuck on generating the key.
Since adding a field is a project, I assume this has to be done as part of
a foreach loop. But I'm not sure how I can maintain the order while adding
a field to each tuple.

ideas?
Thanks,
lauren
+
Gianmarco De Francisci Mo... 2012-08-14, 10:05
+
Lauren Blau 2012-08-14, 10:38
+
Alan Gates 2012-08-23, 20:43