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

Switch to Threaded View
Pig >> mail # user >> Projecting on a pair of columns inside FOREACH() gives error 2213

Copy link to this message
Projecting on a pair of columns inside FOREACH() gives error 2213
I have a relation built by grouping the join (TCRaw) of a pair of basic relations (SrcFuid and NewCitationRel):

grunt> describe TCGroupedByFuid;
TCGroupedByFuid: {
  group: (SrcFuid::citingdocid: int,
          SrcFuid::seq: int),
  TCRaw: {SrcFuid::citingdocid: int,
          SrcFuid::seq: int,
          NewCitationRel::citeddocid: int,
          NewCitationRel::citingdocid: int,
          NewCitationRel::col: chararray,
          NewCitationRel::seq: int,
          NewCitationRel::year: int,
          NewCitationRel::eds: chararray}}

For each tuple in this relation, I’d like to get (TCRaw. NewCitationRel::citingdocid, TCRaw. NewCitationRel::col).

AA = foreach TCGroupedByFuid {
        FA = TCRaw.(NewCitationRel::citingdocid, NewCitationRel::col);
        generate group, FA;};

But that results in this error:
   ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2213: Error visiting inner plan for ForEach

If I am projecting on just a single column, my result is as expected:

AA = foreach TCGroupedByFuid {
        FA = TCRaw.(NewCitationRel::citingdocid); -- OK with or without parens
        generate group, FA;};

dump AA; -- works fine

What is the syntax I need to refer to a projection on two coordinates inside foreach with relations built like this?

Thanks for any suggestions, or pointers to the docs (believe me I did look first :)


William F Dowling
Sr Technical Specialist, Software Engineering
Thomson Reuters
0 +1 215 823 3853