Hi Users, I've been trying to follow the procedure described in the following page: https://cwiki.apache.org/confluence/display/PIG/HowToContribute and sent an email to the pig development mailing list in order to get some kind of approval for the commit that I'm proposing, however this far I have the feeling that it might not be getting in consideration even though I got a reply (No response since more than 10 days ago). Could you give me some advice in what should be the next steps, share any previous experience about the contribution process or provide me the email of some key contacts?
Regards Alan On Thu, Sep 5, 2013 at 3:51 PM, Alan del Rio <[email protected]> wrote: > Hi Alan, > > Here are my answers: > > 1) Why did you try to use RANK? > I needed to create a second attribute in order to generate a one to one > relationship between the two data bags, names and ids. RANK allowed me to > generate a unique sequence per data bag item according to the tuple > position within the bags after using FLATTEN so that I could have the > following: > > {{record_id:(00001),rank_B1:(1),name:(ALAN)}, {record_id:(00001), > rank_B1:(2),name:(SARAI)}} > {{record_id:(00001),rank_B2:(1),id:(00007)},{record_id:(00001), > rank_B2:(2),id:(00008)}} > > and then try to get something like this (two records): > { > {record_id:(00001),name:(ALAN),id:(00007)}, > {record_id:(00001),name:(SARAI),id:(00008)} > } > > using record_id and rank_B1,rank_B2 to join them. In short RANK gave > consecutive numbers for joining purposes. Like I mentioned it worked well > generating bags B11 and B22, but when I try to join them I got a run time > error during map reduce. > > 2) The semantics here aren't clear to me. record_id appears to be crossed > with name and id but name and id appear to be chosen in order > The problem that I'm dealing with is related to nested entries. The > example record (0001) contains a relation one to many with its attribute > names and besides that each name is associated to an id within the ids > attribute. And all this associations need to be dumped in a table with the > following structure. > > record_id-------name_id (id)--------name. > > This is not cross semantics, actually I had to develop the NLET function > to avoid a cross product. Considering that the example record should only > output 2 records. Number of records = 1 * number of items within the data > bag (ids or names ,which is the same number). > > 3) I'm not familiar with the name NLET.Does that refer to a particular > function or algorithm? > Not really, I just wanted something that could sound similar to the word > "TRIPLET" which refers to a set of items I replaced TRIP with the letter N > because the function can generate sets of N number of items, depending on N > number of data bags , maybe I should just call it SET : P but didn't want > any issue with possible reserved words. > > By the way the data source of the bag A is a record that uses JSON where > it is common to see this kind of nested data. > > Best, Alan > > > > On Wed, Sep 4, 2013 at 10:05 AM, Alan Gates <[email protected]> wrote: > >> A few questions: >> >> 1) Why did you try to use RANK? I don't see how rank is part of this. >> 2) The semantics here aren't clear to me. record_id appears to be >> crossed with name and id but name and id appear to be chosen in order. If >> this is join semantics I'd have expected two more entries in B, one with >> (1, Alan, 8) and one with (1, Sarai, 7). If you were just taking each >> element in order I'd have expected the last row to be (null, Sarai, 8) >> instead. >> 3) I'm not familiar with the name NLET. Does that refer to a particular >> function or algorithm? >> >> Alan. >> >> On Aug 31, 2013, at 6:20 PM, Alan del Rio Mendez wrote: >> >> > Hi Dev Team, >> > >> > I developed a UDF to handle the following situation on pig 10.0 and >> want to >> > see if I could contribute with it to the project. >> > >> > Let us consider a BAG "A" with the following data: >> > >> > A:{record_id:{00001),names:{(ALAN),(SARAI)}},ids:{(00007),(00008)}} >> > >> > and an expected bag "B" >> > >> > B:{{record_id:(00001),name:(ALAN), >> > id:(00007)},{record_id:(00001),name:(SARAI), id:(00008)}} >> > >> > Basically I propose a UDF "NLET" that takes N data bags containing the >> same >> > M elements each of them and creates M tuples with N fields and that is >> used >> > this way: >> > >> > B = FOREACH A GENERATE record_id, FLATTEN(NLET(names,ids)); >> > >> > I tried to handle the situation described above using JOIN and RANK to >> > join the databags, and even though it is not optimal it dind't work, >> when >> > using RANK for the join it generated runtime errors. >> > >> > B1 = FOREACH A GENERATE record_id, FLATTEN(names); >> > B11 = RANK B1; >> > B2 = FOREACH A GENERATE FLATTEN(ids); >> > B22 = RANK B2; >> > C = JOIN B11 BY rank_B1 LEFT OUTER,B22 by rank_B2; << Run time error >> > >> > I spend some time reading the reference manual information: >> > http://pig.apache.org/docs/r0.8.1/piglatin_ref2.html >> > http://pig.apache.org/docs/r0.11.0/basic.html >> > and didn't identified a workaround to what I'm describing. I also read >> the >> > UDF manual http://wiki.apache.org/pig/UDFManual to develop the function >> > create the NLET UDF. >> > >> > This far the UDF does generate the expected result/tuples but doesn't >> add >> > the schema information. If nobody has implemented this and it is worth >> to >> > approve, I can spend time on adding the schema information and proper >> > documentation. >> > >> > PS. I'm starting to get involved into the community and I will try to >> send >> > emails before future development starts to avoid duplicated efforts. >> > >> > Best regards >> > Alan del Rio >> >> >> -- >> CONFIDENTIALITY NOTICE >> NOTICE: This message is intended for the use of the individual or entity >> to >> which it is addressed and may contain information that is confidential, >> privileged and exempt from disclosure under applicable law. If the reader >> of this message is not the intended recipient, you are hereby notified >> that >> any printing, copying, dissemination, distribution, disclosure or >> forwarding of this communication is strictly prohibited. If you have >> received this communication in error, please contact the sender >> immediately >> and delete it from your system. Thank You. >> > >
