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

Support scalar relationship in nested foreach

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated: