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

Grammar should be as consistent as possible within and without foreach blocks

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.8.1, 0.9.0, 0.10.0
    • None
    • None
    • None

    Description

      This works:

      a = load 'thing';
      b = foreach (group a all) {
      sorted = order a by $0;
      top = limit sorted 100;
      generate flatten(top);
      }

      This does not:

      a = load 'thing';
      b = foreach (group a all) {
      top = limit (order a by $0) 100;
      generate flatten(top);
      }

      It is very confusing that this syntax works fine outside of the foreach, but does not work within it. The pig grammar should seek to be as consistent and usable as possible, except when there are hard, documented limitations (such as nested foreach inside a foreach block)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jcoveney Jonathan Coveney
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: