Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-2123

Support scalar relationship in nested foreach

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      It would be nice to have the possibility to compute and use scalar relationship inside a nested foreach block.

      As an example, the following code is not currently supported by Pig.

      a = LOAD 'data.txt' AS (id:chararray, num:int);                                                      
      b = GROUP a BY id; 
      c = FOREACH b { n = COUNT(a); d = FILTER a BY num == n; GENERATE d; };
      

      This would be useful with LIMIT and SAMPLE as well.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              azaroth Gianmarco De Francisci Morales
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: